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§
Sourcetype Subscription: Subscription
type Subscription: Subscription
The concrete subscription handle returned by try_subscribe.
Sourcetype SubscribeError: Error + Send + Sync + 'static
type SubscribeError: Error + Send + Sync + 'static
The error returned when subscription fails.
Required Methods§
Sourcefn try_subscribe(&self) -> Result<Self::Subscription, Self::SubscribeError>
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.