pub struct ReplayBuffer<T, Codec = Default> { /* private fields */ }
Expand description

A buffer that stores and replays values sent to a channel.

Values sent to the replay channel buffer are stored in an internal buffer. Multiple remote MPSC channels can be subscribed to the replay channel buffer and each channel will receive all values sent to the replay channel buffer, even the values that were received before it was subscribed.

Drop this to free the buffer and close all subscribed channels.

Implementations

Creates a new replay channel buffer.

The buffer receives its values from the provided local MPSC channel receiver.

Sends a value to the replay channel buffer.

The value will be received by all currently subscribed receivers and all receivers that will be subscribed in the future.

Subscribes a remote MPSC channel to the replay channel buffer.

The channel will receive all values ever sent and future values that will be sent to the replay channel buffer.

The returned SubscriptionHandle can be used to query for errors that occur during sending to the channel.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. 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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more