Skip to main content

DemuxStage

Struct DemuxStage 

Source
pub struct DemuxStage<'a, D: ?Sized>(pub &'a mut D);
Expand description

A Demuxer as a ByteStepper, so every zencodec-io cursor drives it: Need maps to Step::Need, Done to Step::Finished, and every other event is an output.

Tuple Fields§

§0: &'a mut D

Trait Implementations§

Source§

impl<D: Demuxer + ?Sized> ByteStepper for DemuxStage<'_, D>

Source§

type Output = DemuxEvent

What a productive step yields: an image decode event, a demuxed packet.
Source§

type Error = SessionError<<D as Demuxer>::Error>

The stage’s error.
Source§

fn step( &mut self, input: Input<'_>, pulse: Option<&dyn Pulse>, ) -> Result<Stepped<DemuxEvent>, Self::Error>

Take a prefix of input and report what happened. None adds no per-call control; any control retained by the stage remains active.
Source§

fn requested(&self) -> &[InputRequest]

What the stage needs next, after a Step::Need. Never empty then.
Source§

impl<'a, D: Debug + ?Sized> Debug for DemuxStage<'a, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D> !UnwindSafe for DemuxStage<'a, D>

§

impl<'a, D> Freeze for DemuxStage<'a, D>
where D: ?Sized,

§

impl<'a, D> RefUnwindSafe for DemuxStage<'a, D>
where D: RefUnwindSafe + ?Sized,

§

impl<'a, D> Send for DemuxStage<'a, D>
where D: Send + ?Sized,

§

impl<'a, D> Sync for DemuxStage<'a, D>
where D: Sync + ?Sized,

§

impl<'a, D> Unpin for DemuxStage<'a, D>
where D: ?Sized,

§

impl<'a, D> UnsafeUnpin for DemuxStage<'a, D>
where D: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.