Dispose

Trait Dispose 

Source
pub trait Dispose {
    // Required method
    fn dispose(self);
}
Expand description

A trait representing a standard “dispose” method for consuming an object at the end of its scope.

The typical use case of this trait is for encapsulating objects in Disposable wrappers, which will automatically call dispose on drop, but it is perfectly acceptable to call dispose by itself.

See this page for example usage.

Required Methods§

Source

fn dispose(self)

Consume self and deinitialize its contents.

Implementations on Foreign Types§

Source§

impl<'a, T> Dispose for &'a [T]
where &'a [T]: DisposeIterator,

Source§

impl<T> Dispose for Box<[T]>
where Vec<T>: DisposeIterator,

Source§

impl<T> Dispose for Vec<T>
where Vec<T>: DisposeIterator,

Source§

impl<W, T: DisposeWith<W>> Dispose for (W, T)
where (W, T): Sized,

Source§

fn dispose(self)

Dispose self.1, passing self.0 to dispose_with.

Implementors§