[][src]Trait rustracts::Contract

pub trait Contract: Future {
    fn is_expired(&self) -> bool;
fn execute(&self) -> Self::Output;
fn void(&self) -> Self::Output; fn is_valid(&self) -> bool { ... } }

A Contract is a structure that can be invalidated or expired, on expiration the execute method is called, depending on the contract it could produce a value or not. If the contract is not valid at the time of the check it will be voided and could produce a value depending on the contract. Contracts are valid futures that can be run to completion on a reactor or awaited in an async block.

Required methods

fn is_expired(&self) -> bool

Check wether the contract has expired.

fn execute(&self) -> Self::Output

Produce a status of the contract on expiration.

fn void(&self) -> Self::Output

Produce a status of the contract on cancel.

Loading content...

Provided methods

fn is_valid(&self) -> bool

Check wether the contract is still valid

Loading content...

Implementors

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

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

Loading content...