Expand description

In Rust, values’ destructors are automatically run when they go out of scope. However, destructors can be expensive and so you may wish to defer running them until later, when your program has some free time or memory usage is getting high. A bin allows you to put any number of differently-typed values in it, and you can clear them all out, running their destructors, whenever you want.


let bin = drop_bin::Bin::new();

let some_data = "Hello World!".to_owned();
// `some_data`'s destructor is not run.

// `some_data`'s destructor has been run.


A container that holds values for later destruction.