[][src]Struct rustracts::OptionContract

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

Contract that produces a value if secondary context is valid at expiration

Methods

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

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

Trait Implementations

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

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

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

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

type Output = Status<R>

The type of value produced on completion.

Auto Trait Implementations

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

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]