[−][src]Trait rustracts::Contract
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.
Provided methods
Loading content...Implementors
impl<F, C, R> Contract for FuturesContract<F, C, R> where
C: ContractContext + Clone,
F: FnOnce(C) -> R + Clone,
[src]
C: ContractContext + Clone,
F: FnOnce(C) -> R + Clone,
fn is_valid(&self) -> bool
[src]
fn is_expired(&self) -> bool
[src]
fn execute(&self) -> Self::Output
[src]
fn void(&self) -> Self::Output
[src]
impl<F, C, R> Contract for OnKillContract<F, C, R> where
C: ContractContext + Clone,
F: FnOnce(C) -> R + Clone,
[src]
C: ContractContext + Clone,
F: FnOnce(C) -> R + Clone,