pub struct Buffer<T> { /* private fields */ }
Expand description

Buffering mechanism for Temporal data

This struct is a Consumer and Producer which forwards data from a connected Producer to all connected Consumers while performing buffering.

This block may also be used to “suck” parasitic buffers empty. As each flow::Sender has a capacity of 1 (see underlying broadcast_bp channel), a chain of blocks may accumulate a significant buffer volume. This may be unwanted. By placing a Buffer block near the end of the chain and providing a max_age argument equal to or smaller than max_capacity to Buffer::new, the buffer block will consume (and discard) data even when its connected consumer isn’t fast enough.

Implementations

Create new Buffer

The buffer will start with buffering initial_capacity seconds of data before beginning to send out received data. When empty, the buffer will buffer data corresponding to a duration of at least min_capacity seconds before sending out data again. It will suspend receiving when holding strictly more than max_capacity seconds of data. If buffered data is held longer than max_age seconds, it will be discarded.

Trait Implementations

Obtain reference to ReceiverConnector
Connect Consumer to Producer
Disconnect Consumer from any connected Producer if connected
👎Deprecated since 0.2.0: method has been renamed to feed_from
Connect Consumer to Producer
👎Deprecated since 0.2.0: method has been renamed to feed_from_none
Disconnect Consumer from any connected Producer if connected
Obtain reference to SenderConnector
Connect Producer to Consumer
👎Deprecated since 0.2.0: method has been renamed to feed_into
Connect Producer to Consumer

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.