Struct veloren_common::event::EventBus
source · pub struct EventBus<E> {
queue: Mutex<VecDeque<E>>,
}
Fields§
§queue: Mutex<VecDeque<E>>
Implementations§
source§impl<E> EventBus<E>
impl<E> EventBus<E>
pub fn emitter(&self) -> Emitter<'_, E>
pub fn emit_now(&self, event: E)
pub fn recv_all(&self) -> impl ExactSizeIterator<Item = E>
pub fn recv_all_mut(&mut self) -> impl ExactSizeIterator<Item = E>
Trait Implementations§
Auto Trait Implementations§
impl<E> !Freeze for EventBus<E>
impl<E> RefUnwindSafe for EventBus<E>
impl<E> Send for EventBus<E>where
E: Send,
impl<E> Sync for EventBus<E>where
E: Send,
impl<E> Unpin for EventBus<E>where
E: Unpin,
impl<E> UnwindSafe for EventBus<E>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.