[][src]Struct with_drop::WithDrop

pub struct WithDrop<T, F: FnOnce(T)> { /* fields omitted */ }

Container that holds a value and a customestructor

Implementations

impl<T, F: FnOnce(T)> WithDrop<T, F>[src]

pub fn new(inner: T, drop_fn: F) -> Self[src]

pub fn into_inner(self) -> T[src]

This extracts the contained value while dropping the closure and the container.

The custom closure will not be executed.

Trait Implementations

impl<T: Clone, F: Clone + FnOnce(T)> Clone for WithDrop<T, F>[src]

impl<T: Debug, F: Debug + FnOnce(T)> Debug for WithDrop<T, F>[src]

impl<T, F: FnOnce(T)> Deref for WithDrop<T, F>[src]

type Target = T

The resulting type after dereferencing.

impl<T, F: FnOnce(T)> DerefMut for WithDrop<T, F>[src]

impl<T, F: FnOnce(T)> Drop for WithDrop<T, F>[src]

impl<T: Eq, F: Eq + FnOnce(T)> Eq for WithDrop<T, F>[src]

impl<T: Ord, F: Ord + FnOnce(T)> Ord for WithDrop<T, F>[src]

impl<T: PartialEq<T>, F1: FnOnce(T), F2: FnOnce(T)> PartialEq<WithDrop<T, F2>> for WithDrop<T, F1>[src]

impl<T: PartialOrd<T>, F1: FnOnce(T), F2: FnOnce(T)> PartialOrd<WithDrop<T, F2>> for WithDrop<T, F1>[src]

impl<T, F: FnOnce(T)> StructuralEq for WithDrop<T, F>[src]

Auto Trait Implementations

impl<T, F> Send for WithDrop<T, F> where
    F: Send,
    T: Send

impl<T, F> Sync for WithDrop<T, F> where
    F: Sync,
    T: Sync

impl<T, F> Unpin for WithDrop<T, F> where
    F: Unpin,
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.