pub struct ReaderId<T>where
T: 'static,{ /* private fields */ }
Expand description
A reader ID which represents a subscription to the events pushed to the
EventChannel
.
For each reader ID, the last read event is tracked; this way, the buffer
gets grown whenever it would overwrite an event which was not yet observed
by every ReaderId
.
Dropping a ReaderId
effectively cancels the subscription to those events.
Note that as long as a ReaderId
exists, it is crucial to use it to read
the events; otherwise the buffer of the EventChannel
will keep
growing.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ReaderId<T>
impl<T> RefUnwindSafe for ReaderId<T>where
T: RefUnwindSafe,
impl<T> Send for ReaderId<T>where
T: Sync,
impl<T> Sync for ReaderId<T>where
T: Sync,
impl<T> Unpin for ReaderId<T>
impl<T> UnwindSafe for ReaderId<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more