Trait CanStreamSubscription

Source
pub trait CanStreamSubscription {
    // Required method
    fn stream_subscription<S, T>(
        &self,
        stream: S,
    ) -> Arc<dyn Subscription<Item = T>>
       where S: Stream<Item = T> + Async,
             T: Async + Clone;
}
Expand description

Allows multiplexing of a single Stream into a subscription. This is an auto trait implemented by all runtime contexts that implement HasSpawner, HasMutex, CanCreateChannels, CanUseChannels, and CanStreamReceiver.

When the stream terminates, the subscription also terminates.

Required Methods§

Source

fn stream_subscription<S, T>( &self, stream: S, ) -> Arc<dyn Subscription<Item = T>>
where S: Stream<Item = T> + Async, T: Async + Clone,

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§