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(&self, event: &Event<T>)
Available on crate feature async
only.
pub async fn post(&self, event: &Event<T>)
async
only.shorthand for post event to eventbus
Sourcepub async fn post_message(&self, message: T)
Available on crate feature async
only.
pub async fn post_message(&self, message: T)
async
only.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> Freeze for Topic<T>
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