Struct tari_pubsub::TopicSubscriptionFactory
source · [−]pub struct TopicSubscriptionFactory<T, M> { /* private fields */ }
Expand description
This structure hold the Subscriber end of a Pub-Sub channel and can be used to create new filtered subscriber channels.
Implementations
sourceimpl<T, M> TopicSubscriptionFactory<T, M> where
T: Eq + Send,
M: Clone + Send,
impl<T, M> TopicSubscriptionFactory<T, M> where
T: Eq + Send,
M: Clone + Send,
pub fn new(subscriber: TopicSubscriber<T, M>) -> Self
sourcepub fn get_subscription(&self, topic: T) -> impl Stream<Item = M>
pub fn get_subscription(&self, topic: T) -> impl Stream<Item = M>
Provide a subscriber (which will be consumed) and a topic to filter it by and this function will return a stream that yields only the desired messages
sourcepub fn get_subscription_fused(&self, topic: T) -> Fuse<impl Stream<Item = M>>
pub fn get_subscription_fused(&self, topic: T) -> Fuse<impl Stream<Item = M>>
Provide a fused version of the subscription stream so that domain modules don’t need to know about fuse()
Auto Trait Implementations
impl<T, M> !RefUnwindSafe for TopicSubscriptionFactory<T, M>
impl<T, M> Send for TopicSubscriptionFactory<T, M> where
M: Send + Sync,
T: Send + Sync,
impl<T, M> Sync for TopicSubscriptionFactory<T, M> where
M: Send + Sync,
T: Send + Sync,
impl<T, M> Unpin for TopicSubscriptionFactory<T, M>
impl<T, M> !UnwindSafe for TopicSubscriptionFactory<T, M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more