[][src]Struct tari_pubsub::TopicSubscriptionFactory

pub struct TopicSubscriptionFactory<T, M> { /* fields omitted */ }

This structure hold the Subscriber end of a Pub-Sub channel and can be used to create new filtered subscriber channels.

Methods

impl<T, M> TopicSubscriptionFactory<T, M> where
    T: Eq + Send,
    M: Clone + Send
[src]

pub fn new(subscriber: TopicSubscriber<T, M>) -> Self[src]

pub fn get_subscription(&self, topic: T) -> impl Stream<Item = M>[src]

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

pub fn get_subscription_fused(&self, topic: T) -> Fuse<impl Stream<Item = M>>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.