Skip to main content

Subscribable

Trait Subscribable 

Source
pub trait Subscribable {
    type Subscription: Subscription;
    type SubscribeError: Error + Send + Sync + 'static;

    // Required method
    fn try_subscribe(&self) -> Result<Self::Subscription, Self::SubscribeError>;
}
Expand description

Output stream backend that can reject consumer subscriptions.

Required Associated Types§

Source

type Subscription: Subscription

The concrete subscription handle returned by try_subscribe.

Source

type SubscribeError: Error + Send + Sync + 'static

The error returned when subscription fails.

Required Methods§

Source

fn try_subscribe(&self) -> Result<Self::Subscription, Self::SubscribeError>

Creates a new subscription for a consumer, or returns why the consumer cannot be started.

§Errors

Returns Self::SubscribeError when the backend cannot start a new consumer, for example because a single-subscriber backend already has an active consumer.

Implementors§