Skip to main content

Demuxer

Trait Demuxer 

Source
pub trait Demuxer {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn step(
        &mut self,
        input: Input<'_>,
        pulse: Option<&dyn Pulse>,
    ) -> Result<DemuxProgress, SessionError<Self::Error>>;
    fn requested(&self) -> &[InputRequest];
    fn tracks(&self) -> &[TrackInfo];

    // Provided methods
    fn access_pattern(&self) -> AccessPattern { ... }
    fn seek(
        &mut self,
        target: &SeekTarget,
    ) -> Result<SeekStatus, SessionError<Self::Error>> { ... }
}
Expand description

A sans-I/O container reader. See the module docs.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The implementation’s error (malformed or truncated input).

Required Methods§

Source

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

Take a prefix of input and report what happened.

Source

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

What the demuxer needs next, after DemuxEvent::Need. Never empty then.

Source

fn tracks(&self) -> &[TrackInfo]

The tracks; empty before DemuxEvent::Headers.

Provided Methods§

Source

fn access_pattern(&self) -> AccessPattern

How the demuxer reads its input. Default: front to back.

Source

fn seek( &mut self, target: &SeekTarget, ) -> Result<SeekStatus, SessionError<Self::Error>>

Reposition. Default: unsupported.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§