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

Block acting as Consumer, which uses a callback as sink

RecvErrors are ignored by this block. Use ContinuousClosureSink if you need a guarantee that the received data is complete and without interruptions.

Implementations

Create block which invokes the process closure for received data

Create block which invokes the process closure for received data and awaits its result

This function is the same as ClosureSink::new but accepts an asynchronously working closure.

Consume the block but continue operation as long as there is a connected Producer

Wait as long as there is a connected Producer

Stop operation

This is effectively the same as dropping the block, but a panic in the background task is propagated to the caller of stop.

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

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.