[][src]Crate market

Infrastructure for producers and consumers in a market.

A market is a stock of goods. A producer stores goods in the market while a consumer retrieves goods from the market.

In the rust stdlib, the primary example of a market is std::sync::mpsc::channel. std::sync::mpsc::Sender is the producer and std::sync::mpsc::Receiver is the consumer.

Modules

channel

Implements Consumer and Producer for various types of channels.

io

Implements Consumer and Producer for std::io::Read and std::io::Write trait objects.

process

Implements Consumer and Producer for the stdio's of a process.

Structs

Adapter

A Consumer that maps the consumed good to a new good.

ClosedMarketError

An error interacting with a market due to the market being closed.

Collector

A Consumer that consumes goods of type G from multiple Consumers.

ComposingConsumer

Consumes composite goods of type G from a parts Consumer of type C.

NonComposible

The Error thrown when failing to compose parts into a composite good.

PermanentQueue

An unlimited queue with a producer and consumer that are always functional.

Recall

Returns a good that a Producer failed to produce.

StrippingConsumer

Consumes parts from a Consumer of composite goods.

StrippingProducer

A Producer of type P that produces parts stripped from goods of type G.

UnlimitedQueue

Defines a queue with unlimited size that implements Consumer and Producer.

VigilantConsumer

Consumes goods that an Inspector has allowed.

Enums

ConsumeFailure

The Consumer failed to consume a good.

ProduceFailure

The Producer failed to produce a good.

Traits

ComposeFrom

Converts an array of parts into a composite good.

Consumer

Retrieves goods from a market.

Inspector

Inspects if goods meet defined requirements.

Producer

Stores goods in a market.

StripFrom

Converts a single good into parts.