[][src]Struct structural::utils::RunOnDrop

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

A wrapper type to run a closure(F type parameter) with a value(T type parameter).

This type allows accessing the value before it's passed by value to the closure.

Implementations

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

pub fn new(value: T, function: F) -> Self[src]

Constructs this RunOnDrop.

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

pub fn get_mut(&mut self) -> &mut T[src]

Reborrows the wrapped value mutably.

impl<'a, T, F> RunOnDrop<&'a mut T, F> where
    F: FnOnce(&'a mut T), 
[src]

pub fn reborrow(&self) -> &T[src]

Reborrows the wrapped reference.

pub fn reborrow_mut(&mut self) -> &mut T[src]

Reborrows the wrapped reference mutably.

Trait Implementations

impl<'a, T, F> Drop for RunOnDrop<T, F> where
    F: FnOnce(T), 
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<This, T> Array0<T> for This where
    This: ?Sized
[src]

impl<This, V, T> Array0Variant<T, V> for This where
    This: ?Sized
[src]

impl<This, T> ArrayMove0<T> for This where
    This: ?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<This, T> IntoStructural<T> for This where
    T: FromStructural<This>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[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.

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

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

The error type returned when the conversion fails.

impl<This, T> TryIntoStructural<T> for This where
    T: TryFromStructural<This>, 
[src]

type Error = <T as TryFromStructural<This>>::Error

The error parameter of TryFromError, returned from try_into_structural on conversion error. Read more

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

type Type = T

The same type as Self. Read more