[][src]Struct rustracts::OnKillContract

#[must_use = "contracts do nothing unless polled or awaited"]
pub struct OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
{ /* fields omitted */ }

Permanent contract that produces a value when it is voided by the underlying context.

Methods

impl<F, C, R> OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
[src]

pub fn new(context: C, on_void: F) -> Self[src]

Trait Implementations

impl<F, C, R> Contract for OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
[src]

impl<F, C, R> ContractExt for OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
[src]

type Context = LockWeak<Mutex<C>>

Return type of get_context

impl<F, C, R> Future for OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
[src]

type Output = Status<R>

The type of value produced on completion.

impl<F, C, R> FusedFuture for OnKillContract<F, C, R> where
    C: ContractContext,
    F: FnOnce(C) -> R, 
[src]

Auto Trait Implementations

impl<F, C, R> !Send for OnKillContract<F, C, R>

impl<F, C, R> !Sync for OnKillContract<F, C, R>

impl<F, C, R> Unpin for OnKillContract<F, C, R> where
    F: Unpin

impl<F, C, R> !UnwindSafe for OnKillContract<F, C, R>

impl<F, C, R> !RefUnwindSafe for OnKillContract<F, C, R>

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]