pub trait ChannelConsumer<'a, DerivedItemType: 'a + Debug> {
// Required methods
fn consume(&self, stream_id: u32) -> Option<DerivedItemType>;
fn keep_stream_running(&self, stream_id: u32) -> bool;
fn register_stream_waker(&self, stream_id: u32, waker: &Waker);
fn drop_resources(&self, stream_id: u32);
}
Expand description
Source of events for MutinyStream.
Required Methods§
Sourcefn consume(&self, stream_id: u32) -> Option<DerivedItemType>
fn consume(&self, stream_id: u32) -> Option<DerivedItemType>
Delivers the next event, whenever the Stream wants it.
IMPLEMENTORS: use #[inline(always)]
Sourcefn keep_stream_running(&self, stream_id: u32) -> bool
fn keep_stream_running(&self, stream_id: u32) -> bool
Returns false
if the Stream
has been signaled to end its operations, causing it to report “out-of-elements” as soon as possible.
IMPLEMENTORS: use #[inline(always)]
Sourcefn register_stream_waker(&self, stream_id: u32, waker: &Waker)
fn register_stream_waker(&self, stream_id: u32, waker: &Waker)
Shares, to implementors concern, how stream_id
may be awaken.
IMPLEMENTORS: use #[inline(always)]
Sourcefn drop_resources(&self, stream_id: u32)
fn drop_resources(&self, stream_id: u32)
Reports no more elements will be required through [provide()].
IMPLEMENTORS: use #[inline(always)]