adrop 0.2.1

Simple and fast dedicated thread drop.
Documentation
  • Coverage
  • 71.43%
    5 out of 7 items documented5 out of 5 items with examples
  • Size
  • Source code size: 18.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.74 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • CedarHuang/adrop
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CedarHuang

adrop

Simple and fast dedicated thread drop.

Latest version Documentation License

Getting Started

Add the following dependency to your Cargo manifest...

[dependencies]
adrop = "0.2"

Example

extern crate adrop;

use adrop::*;

struct Test {}

impl Drop for Test {
    fn drop(&mut self) {
        println!(
            "Dropping HasDrop! ThreadId: {:?}",
            std::thread::current().id()
        );
    }
}

fn main() {
    println!("Main ThreadId: {:?}", std::thread::current().id());
    adrop(Test {});
    // Output:
    // Main ThreadId: ThreadId(1)
    // Dropping HasDrop! ThreadId: ThreadId(2)
}

Or you can use Adrop wrapper to realize automatic adrop:

let _ = Adrop::new(Test {});

License