Skip to main content

Module container

Module container 

Source
Expand description

Containers.

A Demuxer is sans-I/O and speaks the image decoders’ dialogue: the driver offers an Input, the demuxer takes a prefix and either yields a DemuxEvent or names what it requested next. DemuxStage makes any demuxer a [zencodec_io::ByteStepper], so every zencodec-io cursor (slice, ReadAt with coalesced ranges, Read, async) drives it; a container that needs its index first (an MP4 with moov at the end) asks for that range and declares AccessPattern::RandomAccess.

A Muxer takes packets and lets the caller pull its bytes through pending_output / consume_output / take_output, as a streaming image encoder does. Muxer::begin says, through MuxTiming, whether bytes stream and whether finish patches earlier bytes (sizes, offsets); a caller whose destination cannot seek back passes MuxHint::forward_only and gets a layout without patches, or a refusal at begin.

Borrowed Pulse arguments are optional. None adds no per-call control; retained job controls and structural limits still apply. Forwarding adapters pass the original option through to the implementation.

Structs§

ByteRange
A byte span within an image file or stream.
DemuxProgress
The result of one Demuxer::step.
DemuxStage
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.
Input
Bytes offered to one step.
MuxFinish
Shared completion and patch types; retained paths for media implementations. Remaining output and ordered replacements returned by a producer.
MuxHint
What the caller tells a muxer about its destination.
MuxTiming
When a muxer’s bytes arrive and whether it must patch earlier bytes at finish (the writer-capability split: seekable fix-ups versus forward-only emission).
MuxerShim
Shim erasing a muxer’s error type (the DynAnimationFrameEncoder pattern: a wrapper, not a blanket impl, so method names never collide).
Patch
Shared completion and patch types; retained paths for media implementations. Bytes to write over earlier output.
SeekResult
What a seek actually landed on: the real timestamp and ordinal, never the request echoed back, plus the container’s random-access evidence.
SeekTarget
Where to seek.

Enums§

AccessPattern
How a decoder reads its input, declared so drivers can size a buffer or choose a fetch strategy for unseekable streams.
DemuxEvent
What one demuxer step produced.
InputRequest
What an incremental decoder needs before it can continue.
PatchError
Shared completion and patch types; retained paths for media implementations. A patch that does not fit the file.
SeekMode
Which presentation a seek selects relative to the target time.
SeekScope
Which packets a seek may land on.
SeekStatus
What seek did.

Traits§

Demuxer
A sans-I/O container reader. See the module docs.
DynMuxer
Object-safe muxer (finish by box), the DynAnimationFrameEncoder pattern.
Muxer
A container writer whose bytes the caller pulls. See the module docs.

Functions§

apply_finishDeprecated
Apply a finish to an in-memory file: append the tail, then patch.
erase_muxer
Erase a muxer’s error type.

Type Aliases§

RequestDeprecated
Deprecated byte-input request name; use InputRequest.