Function adrop::adrop [−][src]
pub fn adrop<T: Send + 'static>(trash: T)
Pass the value to a dedicated thread for destruction.
Examples
use adrop::adrop; struct Test {} impl Drop for Test { fn drop(&mut self) { println!( "Dropping HasDrop! ThreadId: {:?}", std::thread::current().id() ); } } println!("Main ThreadId: {:?}", std::thread::current().id()); adrop(Test {});
Output:
Main ThreadId: ThreadId(1)
Dropping HasDrop! ThreadId: ThreadId(2)