Module panda_pile::nb_send [−][src]
Expand description
Nonblocking, threadsafe traits for lazily producing or consuming sequences of arbitrary length, and functions for piping producers into consumers. All asynchronous APIs are derived from the corresponding synchronous APIs through the process described in the crate documentation. These APIs are identical to those in the nb
module, except that all associated futures are required to be Send
and can thus be scheduled on a multithreaded event loop.
A Producer
emits a sequence one item at a time, a generalized and buffered variation on the core::iter::Iterator
trait. A BulkProducer
extends those capabilities with the option of producing multiple items at a time, yielding a generalized std::io::Read
abstraction.
Dually, a Consumer
processes a sequence one item at a time. A BulkConsumer
can further process multiple items at a time, yielding a generalized std::io::Write
abstraction.
Traits
A BulkConsumer
is a Consumer
that can consume multiple items at a time.
A BulkProducer
is a Producer
that can produce multiple items at a time.
Functions
The BulkConsumer
consumes a non-zero number of items from the provided buffer, and
returns how many it has consumed.
The BulkProducer
produces a non-zero number of items into the provided buffer, and
returns how many it has produced. The memory in the buffer does not need to be initialized.
Pipes all items from the BulkProducer
into the BulkConsumer
via the bulk_consume
method.
Pipes all items from the BulkProducer
into the BulkConsumer
via the bulk_produce
method.