[−][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 in its stock. Producers add goods to the stock while consumers remove goods from the stock. One important characteristic of producers and consumers is that they are not modified by their respective action (producing or consuming). In other words, the signature of the action function starts with fn action(&self
, not fn action(&mut self
.
Modules
channel |
|
io | Implements a |
Structs
ApprovedProducer | Produces goods that an |
ClosedMarketError | An error consuming a good from a closable market. |
Collector | A |
ComposingConsumer | Consumes composite goods of type |
MappedConsumer | A |
PermanentQueue | An unlimited queue with a producer and consumer that are always functional. |
StrippingConsumer | Consumes parts from a |
StrippingProducer | A |
UnlimitedQueue | Defines a queue with unlimited size that implements |
VigilantConsumer | Consumes goods that an |
Enums
NeverErr | An error that will never occur, equivalent to |
OneShotError | An error when a |
StripError | An error producing parts. |
Traits
ComposeFrom | Converts an array of parts into a composite good. |
Consumer | Consumes goods from the stock of a market. |
Inspector | Inspects if goods meet defined requirements. |
Producer | Produces goods to be stored in the stock of a market. |
StripFrom | Converts a single good into parts. |