[][src]Trait dispose::DisposeWith

pub trait DisposeWith<W> {
    fn dispose_with(self, with: W);
}

A helper trait for objects that must be consumed with the help of another value.

If the method to consume a value is an associated function or requires additional arguments that cannot be determined at compile-time, this trait provides a simple way to implement Dispose for any container that has both the value to be disposed and any other values necessary, as demonstrated with this implementation for pairs.

Required methods

fn dispose_with(self, with: W)

Dispose self, using the provided value.

Loading content...

Implementations on Foreign Types

impl<W, T> DisposeWith<W> for Vec<T> where
    Vec<T>: DisposeIteratorWith<W>, 
[src]

impl<W, T> DisposeWith<W> for Box<[T]> where
    Vec<T>: DisposeIteratorWith<W>, 
[src]

impl<'a, W, T> DisposeWith<W> for &'a [T] where
    &'a [T]: DisposeIteratorWith<W>, 
[src]

Loading content...

Implementors

impl<W, F: FnOnce(W)> DisposeWith<W> for F[src]

fn dispose_with(self, with: W)[src]

Run the closure with the given parameter, consuming both.

Loading content...