pub struct EventBus { /* private fields */ }Expand description
Implementations§
Source§impl EventBus
impl EventBus
pub fn send<T: Send + Sync + 'static>(&mut self, event: T)
pub fn read<T: Send + Sync + 'static>(&self) -> &[T]
Sourcepub fn read_frame<T: Send + Sync + 'static>(&self) -> &[T]
pub fn read_frame<T: Send + Sync + 'static>(&self) -> &[T]
The events of type T settled at the last update: the
previous frame’s frozen set, broadcast to every reader without a cursor.
See EventChannel::read_frame.
pub fn read_since<T: Send + Sync + 'static>(&self, cursor: u64) -> &[T]
pub fn consume<T: Send + Sync + 'static>(&self, cursor: &mut u64) -> &[T]
pub fn sequence<T: Send + Sync + 'static>(&self) -> u64
pub fn trim<T: Send + Sync + 'static>(&mut self, up_to_sequence: u64)
pub fn clear<T: Send + Sync + 'static>(&mut self)
pub fn channel_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EventBus
impl !UnwindSafe for EventBus
impl Freeze for EventBus
impl Send for EventBus
impl Sync for EventBus
impl Unpin for EventBus
impl UnsafeUnpin for EventBus
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