[][src]Crate market

A library to standardize the traits of producing and consuming.

The core purpose of this library is to define the traits of items that interact with markets. A market stores goods that have been produced in its stock until they are consumed.

Modules

channel

Consumer and Producer implementations for different channel implementations.

Structs

ApprovedProducer

Produces goods that an Inspector has allowed.

ByteWriter

Produces bytes to a writer of type W.

ClosedMarketError

An error consuming a good from a closable market.

GoodsIter

An Iterator that yields consumed goods, blocking if necessary.

PermanentQueue

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

Reader

Reads goods of type G from a reader of type R.

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

NeverErr

An error that will never occur, equivalent to !.

StripError

An error producing parts.

Traits

ComposeFrom

Converts an array of parts into a composite good.

Consumer

Consumes goods by retrieving them from the stock of a market.

Inspector

Inspects if goods meet defined requirements.

Producer

Produces goods by adding them to the stock of a market.

StripFrom

Converts a single good into parts.