pub trait ChannelUni<'a, ItemType: Debug + Send + Sync, DerivedItemType: Debug> {
// Required method
fn create_stream(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)
where Self: ChannelConsumer<'a, DerivedItemType>;
}
Expand description
Defines abstractions specific to [Uni] channels
Required Methods§
Sourcefn create_stream(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
fn create_stream(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
Returns a Stream
(and its stream_id
) able to receive elements sent through this channel.
If called more than once, each Stream
will receive a different element – “consumer pattern”.
Currently panic
s if called more times than allowed by [Uni]’s MAX_STREAMS
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.