pub struct Disposable<T: Dispose>(_);
Expand description
Wrapper for values implementing Dispose that provides a Drop
implementation.
This struct will automatically consume its contents on drop using the
provided Dispose implementation.
See this page for example usage.
Construct a new Disposable instance, wrapping around val.
Consume the wrapper, producing the contained value.
It is up to the user to ensure the value does not fall out of scope
without being consumed.
The value can be safely re-inserted into a Disposable using
Disposable::new to restore safe drop behavior, and it is
recommended that the value is held by some container which
consumes it on drop at all times. The intended use case for this
function is transferring the value from one container to the other.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Mutably dereferences the value.
Executes the destructor for this type. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.