Skip to main content

SequencerExt

Trait SequencerExt 

Source
pub trait SequencerExt: Stream {
    // Provided methods
    fn sequencer(self, timeout: Duration, capacity: usize) -> Sequencer<Self>
       where Self::Item: Ord + PartialOrd<FrameId>,
             Self: Sized { ... }
    fn sequencer_with_max_age(
        self,
        timeout: Duration,
        capacity: usize,
        max_item_age: Option<Duration>,
    ) -> Sequencer<Self>
       where Self::Item: Ord + PartialOrd<FrameId>,
             Self: Sized { ... }
    fn sequencer_with(self, cfg: SequencerConfig) -> Sequencer<Self>
       where Self::Item: Ord + PartialOrd<FrameId>,
             Self: Sized { ... }
}
Expand description

Stream extensions methods for item sequencing.

Provided Methods§

Source

fn sequencer(self, timeout: Duration, capacity: usize) -> Sequencer<Self>
where Self::Item: Ord + PartialOrd<FrameId>, Self: Sized,

Attaches a Sequencer to the underlying stream, given the item timeout and capacity of items.

Source

fn sequencer_with_max_age( self, timeout: Duration, capacity: usize, max_item_age: Option<Duration>, ) -> Sequencer<Self>
where Self::Item: Ord + PartialOrd<FrameId>, Self: Sized,

As SequencerExt::sequencer, but discards items buffered longer than max_item_age instead of emitting them late.

Source

fn sequencer_with(self, cfg: SequencerConfig) -> Sequencer<Self>
where Self::Item: Ord + PartialOrd<FrameId>, Self: Sized,

As SequencerExt::sequencer, with every stopping rule stated explicitly.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> SequencerExt for T
where T: Stream + ?Sized,