Struct comet_eventbus::Topic
source · pub struct Topic<T> { /* private fields */ }
Expand description
A Topic
wrapper for a TopicKey
Implementations§
source§impl<T: Send + Sync + 'static> Topic<T>
impl<T: Send + Sync + 'static> Topic<T>
sourcepub async fn post_message(&self, message: T)
pub async fn post_message(&self, message: T)
shorthand for post message to eventbus
source§impl<T> Topic<T>
impl<T> Topic<T>
sourcepub fn create_event(&self, message: T) -> Event<T>
pub fn create_event(&self, message: T) -> Event<T>
create an event from message
sourcepub fn get_listeners(&self) -> &EventListeners<T>
pub fn get_listeners(&self) -> &EventListeners<T>
get event listeners subscribed to this topic
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Topic<T>
impl<T> Send for Topic<T>
impl<T> Sync for Topic<T>
impl<T> Unpin for Topic<T>
impl<T> !UnwindSafe for Topic<T>
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