Struct radiorust::flow::Sender

source ·
pub struct Sender<T> { /* private fields */ }
Expand description

Sender that can be dynamically connected to a Receiver

To send data to the connected Receivers, use Sender::send. Call Sender::reset to indicate missing data and Sender::finish to indicate end of stream.

Connecting the Sender to a Receiver is done by passing a SenderConnector reference to ReceiverConnector::connect. The SenderConnector is obtained when calling new_sender.

There is buffer capacity of 1 for each Sender, i.e. Sender::send completes immediately for the first value sent or after all Receivers have received the previous value. (Note: In some cases, Sender::send may wait until receiving is attempted by one Receiver. This is because the broadcast_bp::Sender might not see a broadcast_bp::Receiver as subscriber yet.)

Implementations

Wait until ready to send

The returned Reservation handle may be used to send a value immediately (through Reservation::send, which is not async).

Check if ready to send

The returned Reservation handle may be used to send a value immediately (through Reservation::send, which is not async).

This method returns Ok(None) if it’s not possible to send a value immediately.

Send data to all Receivers which have been connected

Notify all Receivers that some data is missing or that the data stream has been restarted

Notify all Receivers that the data stream has been completed

Propagate a RecvError to all Receivers

RecvError::Closed is mapped to RecvError::Reset because a Receiver may be reconnected with another Sender later.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.