brexit

Crates.iobrexit
lib.rsbrexit
version1.0.1
sourcesrc
created_at2020-03-30 16:16:42.536648
updated_at2020-03-30 16:44:58.138136
descriptionimpl Drop but slowly
homepage
repositoryhttps://github.com/TheZoq2/brexit
max_upload_size
id224445
size2,872
Frans Skarman (TheZoq2)

documentation

README

Brexit

For when you want to get rid of an object, you just need to do some administration first.

Usage example

This program will print "The UK has left" after 3 years.

    struct UnitedKingdom {}

    impl Drop for UnitedKingdom {
        fn drop(&mut self) {
            println!("The UK has left")
        }
    }

    fn main() {
        let uk = UnitedKingdom{};
        brexit(uk);
        thread::sleep(Duration::from_secs(60*60*24*365*4));
    }

I put all the blame @Dylan-DPC for encouraging me to make this abomination very useful crate.

Commit count: 5

cargo fmt