pub trait ChannelMulti<'a, ItemType: Debug + Send + Sync, DerivedItemType: Debug> {
// Required methods
fn create_stream_for_old_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)
where Self: ChannelConsumer<'a, DerivedItemType>;
fn create_stream_for_new_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)
where Self: ChannelConsumer<'a, DerivedItemType>;
fn create_streams_for_old_and_new_events(
self: &Arc<Self>,
) -> ((MutinyStream<'a, ItemType, Self, DerivedItemType>, u32), (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32))
where Self: ChannelConsumer<'a, DerivedItemType>;
fn create_stream_for_old_and_new_events(
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_for_old_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
fn create_stream_for_old_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
Implemented only for a few [Multi] channels, returns a Stream
(and its stream_id
) able to receive elements
that were sent through this channel before the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log
based channels are able to see all past events.
If called more than once, every stream will see all the past events available.
Currently panic
s if called more times than allowed by [Multi]’s MAX_STREAMS
Sourcefn create_stream_for_new_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
fn create_stream_for_new_events(
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 after the call to this method.
If called more than once, each Stream
will see all new elements – “listener pattern”.
Currently panic
s if called more times than allowed by [Multi]’s MAX_STREAMS
Sourcefn create_streams_for_old_and_new_events(
self: &Arc<Self>,
) -> ((MutinyStream<'a, ItemType, Self, DerivedItemType>, u32), (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32))where
Self: ChannelConsumer<'a, DerivedItemType>,
fn create_streams_for_old_and_new_events(
self: &Arc<Self>,
) -> ((MutinyStream<'a, ItemType, Self, DerivedItemType>, u32), (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32))where
Self: ChannelConsumer<'a, DerivedItemType>,
Implemented only for a few [Multi] channels, returns two Stream
s (and their stream_id
s):
- one for the past events (that, once exhausted, won’t see any of the forthcoming events)
- another for the forthcoming events.
The split is guaranteed not to miss any events: no events will be lost between the last of the “past” and
the first of the “forthcoming” events.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log
based channels are able to see all past events.
If called more than once, every stream will see all the past events available, as well as all future events after this method call.
Currently panic
s if called more times than allowed by [Multi]’s MAX_STREAMS
Sourcefn create_stream_for_old_and_new_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
fn create_stream_for_old_and_new_events(
self: &Arc<Self>,
) -> (MutinyStream<'a, ItemType, Self, DerivedItemType>, u32)where
Self: ChannelConsumer<'a, DerivedItemType>,
Implemented only for a few [Multi] channels, returns a single Stream
(and its stream_id
) able to receive elements
that were sent through this channel either before and after the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log
based channels are able to see all past events.
Notice that, with this method, there is no way of discriminating where the “old” events end and where the “new” events start.
If called more than once, every stream will see all the past events available, as well as all future events after this method call.
Currently panic
s if called more times than allowed by [Multi]’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.