[][src]Struct pir_8_emu::binutils::pir_8_emu::QuickscopeWrapper

#[repr(transparent)]
pub struct QuickscopeWrapper<F: FnOnce()>(pub Option<F>);

Execute the contained funxion when this object is dropped

Examples

let mut hewwo = true;
{
   let _hewwo_destructor = QuickscopeWrapper(Some(|| hewwo = false));
   assert!(hewwo);
}
assert!(!hewwo);

Trait Implementations

impl<F: Clone + FnOnce()> Clone for QuickscopeWrapper<F>[src]

impl<F: Debug + FnOnce()> Debug for QuickscopeWrapper<F>[src]

impl<F: FnOnce()> Drop for QuickscopeWrapper<F>[src]

impl<F: Eq + FnOnce()> Eq for QuickscopeWrapper<F>[src]

impl<F: Hash + FnOnce()> Hash for QuickscopeWrapper<F>[src]

impl<F: Ord + FnOnce()> Ord for QuickscopeWrapper<F>[src]

impl<F: PartialEq + FnOnce()> PartialEq<QuickscopeWrapper<F>> for QuickscopeWrapper<F>[src]

impl<F: PartialOrd + FnOnce()> PartialOrd<QuickscopeWrapper<F>> for QuickscopeWrapper<F>[src]

impl<F: FnOnce()> StructuralEq for QuickscopeWrapper<F>[src]

impl<F: FnOnce()> StructuralPartialEq for QuickscopeWrapper<F>[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for QuickscopeWrapper<F> where
    F: RefUnwindSafe

impl<F> Send for QuickscopeWrapper<F> where
    F: Send

impl<F> Sync for QuickscopeWrapper<F> where
    F: Sync

impl<F> Unpin for QuickscopeWrapper<F> where
    F: Unpin

impl<F> UnwindSafe for QuickscopeWrapper<F> where
    F: 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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.