[][src]Struct rustracts::OptionContract

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

Contract that produces a value if secondary context is valid at expiration and it has not been voided by the first context.

Methods

impl<F, VC, PC, R> OptionContract<F, VC, PC, R> where
    VC: ContractContext,
    PC: ContractContext,
    F: FnOnce((VC, PC)) -> R, 
[src]

pub fn new(expire: Duration, void_c: VC, prod_c: PC, on_exe: F) -> Self[src]

Trait Implementations

impl<F, VC, PC, R> Contract for OptionContract<F, VC, PC, R> where
    VC: ContractContext,
    PC: ContractContext,
    F: FnOnce((VC, PC)) -> R, 
[src]

impl<F, VC, PC, R> ContractExt for OptionContract<F, VC, PC, R> where
    VC: ContractContext,
    PC: ContractContext,
    F: FnOnce((VC, PC)) -> R, 
[src]

type Context = (LockWeak<Mutex<VC>>, LockWeak<Mutex<PC>>)

Return type of get_context

impl<F, VC, PC, R> Future for OptionContract<F, VC, PC, R> where
    VC: ContractContext,
    PC: ContractContext,
    F: FnOnce((VC, PC)) -> R, 
[src]

type Output = Status<R>

The type of value produced on completion.

impl<F, VC, PC, R> FusedFuture for OptionContract<F, VC, PC, R> where
    VC: ContractContext,
    PC: ContractContext,
    F: FnOnce((VC, PC)) -> R, 
[src]

Auto Trait Implementations

impl<F, VC, PC, R> !Send for OptionContract<F, VC, PC, R>

impl<F, VC, PC, R> !Sync for OptionContract<F, VC, PC, R>

impl<F, VC, PC, R> Unpin for OptionContract<F, VC, PC, R> where
    F: Unpin

impl<F, VC, PC, R> !UnwindSafe for OptionContract<F, VC, PC, R>

impl<F, VC, PC, R> !RefUnwindSafe for OptionContract<F, VC, PC, 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]