brexit 1.0.1

impl Drop but slowly
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 2.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 992.48 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • TheZoq2/brexit
    8 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TheZoq2

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.