pub struct Broker<M: Message, T: TopicId> { /* private fields */ }Expand description
Broker that manages topics
Implementations§
Source§impl<M: Message, T: TopicId> Broker<M, T>
impl<M: Message, T: TopicId> Broker<M, T>
Sourcepub fn topic_get(&self, topic: &T) -> Option<Arc<Topic<M>>>
pub fn topic_get(&self, topic: &T) -> Option<Arc<Topic<M>>>
Fetches the given topic if it exists
Sourcepub fn topic_get_or_create(&self, topic: &T) -> Arc<Topic<M>>
pub fn topic_get_or_create(&self, topic: &T) -> Arc<Topic<M>>
Fetches or creates the given topic
Sourcepub fn topic_exists(&self, topic: &T) -> bool
pub fn topic_exists(&self, topic: &T) -> bool
Tells if the given topic exists
Sourcepub fn topic_remove(&self, topic: &T)
pub fn topic_remove(&self, topic: &T)
Removes the given topic. If there are subscribers - they will get a RecvError.
Sourcepub fn subscribe(&self, topic: &T) -> Result<Subscriber<M>, SubscribeError>
pub fn subscribe(&self, topic: &T) -> Result<Subscriber<M>, SubscribeError>
Shorthand for topic_get_or_create().subscribe(topic)
Trait Implementations§
Auto Trait Implementations§
impl<M, T> Freeze for Broker<M, T>
impl<M, T> !RefUnwindSafe for Broker<M, T>
impl<M, T> Send for Broker<M, T>
impl<M, T> Sync for Broker<M, T>
impl<M, T> Unpin for Broker<M, T>
impl<M, T> !UnwindSafe for Broker<M, T>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§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