Struct remoc_obs::mpsc_replay::ReplayBuffer
source · [−]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.
pub fn subscribe<C, B>(&self, tx: Sender<T, C, B>) -> SubscriptionHandleⓘNotable traits for SubscriptionHandleimpl Future for SubscriptionHandle type Output = Result<(), SendError<()>>; where
C: Codec,
B: Size,
pub fn subscribe<C, B>(&self, tx: Sender<T, C, B>) -> SubscriptionHandleⓘNotable traits for SubscriptionHandleimpl Future for SubscriptionHandle type Output = Result<(), SendError<()>>; where
C: Codec,
B: Size,
impl Future for SubscriptionHandle type Output = Result<(), SendError<()>>;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
Auto Trait Implementations
impl<T, Codec = Default> !RefUnwindSafe for ReplayBuffer<T, Codec>
impl<T, Codec> Send for ReplayBuffer<T, Codec> where
Codec: Send,
T: Send,
impl<T, Codec> Sync for ReplayBuffer<T, Codec> where
Codec: Send,
T: Send,
impl<T, Codec> Unpin for ReplayBuffer<T, Codec>
impl<T, Codec = Default> !UnwindSafe for ReplayBuffer<T, Codec>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
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