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 DTrait Implementations§
Source§impl<D: Demuxer + ?Sized> ByteStepper for DemuxStage<'_, D>
impl<D: Demuxer + ?Sized> ByteStepper for DemuxStage<'_, D>
Source§type Output = DemuxEvent
type Output = DemuxEvent
What a productive step yields: an image decode event, a demuxed
packet.
Source§fn step(
&mut self,
input: Input<'_>,
pulse: Option<&dyn Pulse>,
) -> Result<Stepped<DemuxEvent>, Self::Error>
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]
fn requested(&self) -> &[InputRequest]
What the stage needs next, after a
Step::Need. Never empty then.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>
impl<'a, D> Sync for DemuxStage<'a, D>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more