Crate consume_on_drop

Crate consume_on_drop 

Source

Structs§

ConsumeOnDrop
A zero-overhead wrapper around T. When a ConsumeOnDrop<T> is dropped, the underlying T is Consume::consumed.
WithConsumer
A pair consisting of a T and a Consumer<T>. When this pair is dropped, the T will be consumed by the Consumer.

Traits§

Consume
This trait is for types with a specified means of consumption. It is a counterpart to Drop. While Drop::drop takes self by mutable reference, Consume::consume takes self by value.
Consumer
A type implementing Consumer<T> is one which can consume a value of type T. In particular, any FnOnce(T) is also a Consumer<T>.