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

A buffer that stores and replays values sent to it.

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.

When dropped all channels to the subscribers are closed immediately. Use keep if you want to avoid this.

Implementations

Creates a new replay channel buffer.

The replay channel buffer is fed from the receiver rx.

Creates a new replay channel buffer.

The replay channel buffer is fed from the unbounded receiver rx.

When this replay buffer is dropped, ensures that all outstanding values are sent to the subscribers.

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