Struct comet_eventbus::Eventbus
source · pub struct Eventbus { /* private fields */ }
Expand description
An asynchronous Eventbus
to interact with
Implementations§
source§impl Eventbus
impl Eventbus
sourcepub async fn create_topic<T: 'static, K: Into<TopicKey>>(
&self,
topic_key: K
) -> Topic<T>
pub async fn create_topic<T: 'static, K: Into<TopicKey>>( &self, topic_key: K ) -> Topic<T>
create a Topic
using a topic key
sourcepub async fn register<T: 'static, K: Into<TopicKey>, L: Listener<T>>(
&self,
topic_key: K,
listener: L
) -> EventListener<T>
pub async fn register<T: 'static, K: Into<TopicKey>, L: Listener<T>>( &self, topic_key: K, listener: L ) -> EventListener<T>
register a listener to eventbus
sourcepub async fn unregister<T: 'static>(&self, event_listener: EventListener<T>)
pub async fn unregister<T: 'static>(&self, event_listener: EventListener<T>)
unregister an event listener
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Eventbus
impl Send for Eventbus
impl Sync for Eventbus
impl Unpin for Eventbus
impl !UnwindSafe 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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request