Skip to main content

Topic

Trait Topic 

Source
pub trait Topic<M>: Send {
    type Consumer: Consumer<M>;
    type Publisher: Publisher<M>;
    type Selector;

    // Required methods
    fn new_publisher(&self) -> Self::Publisher;
    async fn subscribe(
        &mut self,
        consumer_group: &ConsumerGroup,
        subscription: Subscription<'_, Self::Selector>,
    ) -> Result<Self::Consumer, TopicError>;
}

Required Associated Types§

Required Methods§

Source

fn new_publisher(&self) -> Self::Publisher

Source

async fn subscribe( &mut self, consumer_group: &ConsumerGroup, subscription: Subscription<'_, Self::Selector>, ) -> Result<Self::Consumer, TopicError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§