Crate rustracts

Source
Expand description

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.

Re-exports§

pub use context::ContextError;
pub use context::ContractContext;

Modules§

context
ContractContext implementations. Contexts are elements that can be polled to verify wether their inner state is still considered valid or not.
park
Parkable waker threads.
time
Time utilities.

Structs§

FuturesContract
Duration based contract produces a value at a point in the future using the available context if it has not been voided before. A FuturesContract produces a value from it’s context at it’s expire time if it has not been voided before.
OnKillContract
Permanent contract that produces a value when it is voided by it’s context. Permanent contract that produces a value when it is voided by the underlying context.
OptionContract
Duration based contract produces a value at a point in the future if it has not been voided and secondary context has been realized. Contract that produces a value if secondary context is valid at expiration and it has not been voided by the first context.

Enums§

Status
Status on completion/invalidation of a contract.

Traits§

Contract
Contract Trait
ContractExt
Extention trait for Contracts.