[][src]Struct col_macros::DropBy

pub struct DropBy<T, F> where
    F: FnMut(&mut T), 
{ pub value: T, pub clos: F, }

A wrapper that calls the given closure at Drop. Useful when you have a conditional assign of one that,once assigned,you want to warranty a call to it with the given T,and then drop it.

It derefs to T.

Fields

value: Tclos: F

Methods

impl<T, F> DropBy<T, F> where
    F: FnMut(&mut T), 
[src]

pub fn new(value: T, clos: F) -> DropBy<T, F>[src]

Trait Implementations

impl<T, F> Deref for DropBy<T, F> where
    F: FnMut(&mut T), 
[src]

type Target = T

The resulting type after dereferencing.

impl<T, F> DerefMut for DropBy<T, F> where
    F: FnMut(&mut T), 
[src]

impl<T, F> Drop for DropBy<T, F> where
    F: FnMut(&mut T), 
[src]

Auto Trait Implementations

impl<T, F> RefUnwindSafe for DropBy<T, F> where
    F: RefUnwindSafe,
    T: RefUnwindSafe

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

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

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

impl<T, F> UnwindSafe for DropBy<T, F> where
    F: UnwindSafe,
    T: UnwindSafe

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.