Skip to main content

Module source

Module source 

Source
Expand description

Input abstraction. A container never opens a file — it asks a Source what it can do, and the ladder (see crate::ladder) supplies the best rung.

Re-exports§

pub use decode_side::DecodeSideSource;
pub use decode_side::is_decode_side;
pub use decode_side::mark_decode_side;
pub use limit::Counting;
pub use limit::CountingWriter;
pub use limit::DEFAULT_MAX_RATIO;
pub use limit::RATIO_FLOOR;
pub use limit::RatioGuard;
pub use spill::SpillPolicy;
pub use spill::SpillSource;
pub use stream_only::StreamOnly;

Modules§

decode_side
Marking a Source as sitting BELOW a codec decoder.
limit
Decompression-bomb protection.
spill
Rung 3 of the ladder: spool a non-seekable input so it becomes seekable.
stream_only
Adapter presenting a plain reader as a non-seekable Source.

Structs§

FileSource
A seekable source backed by a real file. The Exact rung.
GuardedSeek
Wraps a seekable reader so a rejected seek POSITION is reported as malformed input rather than as an i/o failure of the medium.
PeekSource
Wraps a source so a bounded prefix can be inspected and then replayed.
ReaderSource
A forward-only source. Models “arrived on a pipe” — it erases any seek ability the underlying reader might happen to have, so tests can exercise the non-seekable path deterministically.
SourceCaps

Constants§

MAX_SEEK_POSITION
The largest absolute position any platform in scope can address: a file offset is an i64 on every unix and on Windows alike, so a u64 above this names a location no file can ever hold.

Traits§

SeekRead
Blanket-implemented marker so &mut dyn SeekRead is usable as a trait object.
Source
An input stream that reports its own capabilities.