Struct jsonrpc_pubsub::manager::SubscriptionManager [−][src]
pub struct SubscriptionManager<I: IdProvider = RandomStringIdProvider> { /* fields omitted */ }
Expand description
Subscriptions manager.
Takes care of assigning unique subscription ids and driving the sinks into completion.
Implementations
Creates a new SubscriptionManager.
Uses RandomStringIdProvider
as the ID provider.
Creates a new SubscriptionManager with the specified ID provider.
Borrows the internal task executor.
This can be used to spawn additional tasks on the underlying event loop.
pub fn add<T, E, G, F>(
&self,
subscriber: Subscriber<T, E>,
into_future: G
) -> SubscriptionId where
G: FnOnce(Sink<T, E>) -> F,
F: Future<Output = ()> + Send + 'static,
pub fn add<T, E, G, F>(
&self,
subscriber: Subscriber<T, E>,
into_future: G
) -> SubscriptionId where
G: FnOnce(Sink<T, E>) -> F,
F: Future<Output = ()> + Send + 'static,
Creates new subscription for given subscriber.
Second parameter is a function that converts Subscriber Sink into a Future. This future will be driven to completion by the underlying event loop
Cancel subscription.
Returns true if subscription existed or false otherwise.
Creates a new SubscriptionManager.
Trait Implementations
Auto Trait Implementations
impl<I = RandomStringIdProvider> !RefUnwindSafe for SubscriptionManager<I>
impl<I> Send for SubscriptionManager<I> where
I: Send,
impl<I> Sync for SubscriptionManager<I> where
I: Sync,
impl<I> Unpin for SubscriptionManager<I> where
I: Unpin,
impl<I = RandomStringIdProvider> !UnwindSafe for SubscriptionManager<I>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V