Trait market::Consumer [−][src]
Retrieves goods from a market.
The order in which goods are retrieved is defined by the implementer.
Associated Types
type Good
[src]
The item being consumed.
type Failure: Failure
[src]
Describes a failure to successfully complete consumption.
Required methods
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
Retrieves the next good from the market without blocking.
SHALL only run in the calling process and return the next good in the market without blocking.
Errors
If fault T
is caught, SHALL throw Self::Failure
F
such that F.fault() == Some(T)
. If self
cannot retrieve a good without blocking, SHALL throw an appropriate Self::Failure
.
Provided methods
fn goods(&self) -> Goods<'_, Self>ⓘ where
Self: Sized,
[src]
Self: Sized,
Returns a Goods
of self
.
fn demand(&self) -> Result<Self::Good, <Self::Failure as Failure>::Fault>
[src]
Retrieves the next good from the market, blocking until one is available.
Errors
If fault T
is caught, SHALL throw T
.
Implementations on Foreign Types
impl<G> Consumer for Receiver<G>
[src]
type Good = G
type Failure = ConsumeFailure<WithdrawnSupply>
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
impl<G> Consumer for Receiver<G>
[src]
type Good = G
type Failure = ConsumeFailure<WithdrawnSupply>
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
Implementors
impl Consumer for Hammer
[src]
type Good = ()
type Failure = InsufficientStockFailure
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
impl<G> Consumer for Procurer<G>
[src]
type Good = G
type Failure = InsufficientStockFailure
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
impl<G> Consumer for Accepter<G>
[src]
type Good = G
type Failure = InsufficientStockFailure
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
impl<G, T> Consumer for Collector<G, T> where
T: TryFrom<ConsumeFailure<T>>,
[src]
T: TryFrom<ConsumeFailure<T>>,