pub struct EventListener { /* private fields */ }Expand description
Event listener for handling events
Implementations§
Source§impl EventListener
impl EventListener
Sourcepub fn new(broadcaster: Arc<EventBroadcaster>) -> Self
pub fn new(broadcaster: Arc<EventBroadcaster>) -> Self
Create a new event listener
Sourcepub async fn subscribe_to_events(
&mut self,
event_types: Vec<EventType>,
) -> Receiver<Event>
pub async fn subscribe_to_events( &mut self, event_types: Vec<EventType>, ) -> Receiver<Event>
Subscribe to specific event types
Sourcepub async fn subscribe_to_entity(&mut self, entity_id: Uuid) -> Receiver<Event>
pub async fn subscribe_to_entity(&mut self, entity_id: Uuid) -> Receiver<Event>
Subscribe to events for a specific entity
Sourcepub fn subscribe_to_all(&self) -> Receiver<Event>
pub fn subscribe_to_all(&self) -> Receiver<Event>
Subscribe to all events
Auto Trait Implementations§
impl Freeze for EventListener
impl !RefUnwindSafe for EventListener
impl Send for EventListener
impl Sync for EventListener
impl Unpin for EventListener
impl !UnwindSafe for EventListener
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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