Trait market::Producer[][src]

pub trait Producer {
    type Good;
    type Failure: Failure;
    fn produce(&self, good: Self::Good) -> Result<(), Self::Failure> { ... }
fn produce_all<I: IntoIterator<Item = Self::Good>>(
        &self,
        goods: I
    ) -> Result<(), Self::Failure>
    where
        Self: Sized
, { ... }
fn force(
        &self,
        good: Self::Good
    ) -> Result<(), <Self::Failure as Failure>::Fault>
    where
        Self::Good: Clone
, { ... }
fn force_all<I: IntoIterator<Item = Self::Good>>(
        &self,
        goods: I
    ) -> Result<(), <Self::Failure as Failure>::Fault>
    where
        Self: Sized,
        Self::Good: Clone
, { ... } }

Specifies the storage of goods into a market.

Associated Types

type Good[src]

The item being produced.

type Failure: Failure[src]

Describes a failure to successfully complete production.

Loading content...

Provided methods

fn produce(&self, good: Self::Good) -> Result<(), Self::Failure>[src]

Stores good in the market without blocking.

SHALL only run in the calling process and return without blocking.

Errors

If fault T is caught, SHALL throw Self::Failure F such that F.fault() == Some(T). If self cannot store good without blocking, SHALL throw an appropriate Self::Failure.

fn produce_all<I: IntoIterator<Item = Self::Good>>(
    &self,
    goods: I
) -> Result<(), Self::Failure> where
    Self: Sized
[src]

Stores each good in goods in the market without blocking.

Errors

If Failure F is caught, SHALL attempt no further goods and throw F.

fn force(
    &self,
    good: Self::Good
) -> Result<(), <Self::Failure as Failure>::Fault> where
    Self::Good: Clone
[src]

Stores good in the market, blocking until space is available.

Errors

If fault T is caught, SHALL throw T

fn force_all<I: IntoIterator<Item = Self::Good>>(
    &self,
    goods: I
) -> Result<(), <Self::Failure as Failure>::Fault> where
    Self: Sized,
    Self::Good: Clone
[src]

Stores every good in goods, blocking until space is available.

Errors

If fault T is caught, SHALL attempt no further goods and throw T.

Loading content...

Implementations on Foreign Types

impl<G> Producer for Sender<G>[src]

type Good = G

type Failure = ProduceFailure<WithdrawnDemand>

Loading content...

Implementors

impl Producer for Trigger[src]

type Good = ()

type Failure = Infallible

impl<G> Producer for StdProducer<G>[src]

type Good = G

type Failure = ProduceFailure<WithdrawnDemand>

impl<G> Producer for Supplier<G>[src]

type Good = G

type Failure = Infallible

impl<G> Producer for Deliverer<G>[src]

type Good = G

type Failure = InsufficientStockFailure

impl<G, T> Producer for Distributor<G, T> where
    T: TryFrom<ProduceFailure<T>>,
    G: Clone
[src]

type Good = G

type Failure = ProduceFailure<T>

impl<G: DisassembleInto<u8>> Producer for Writer<G>[src]

type Good = G

type Failure = WriteFault<G>

Loading content...