Skip to main content

Crate stuffr_core

Crate stuffr_core 

Source
Expand description

Core abstractions for the stuffr toolkit.

This crate deliberately depends on no compression format crate. That constraint is what makes the stream ladder and the thread governor testable against mock formats, with no C toolchain and no real archives.

Re-exports§

pub use archive::ArchiveRead;
pub use archive::ArchiveWrite;
pub use archive::Codec;
pub use archive::Container;
pub use archive::CreateOpts;
pub use archive::DecodeOpts;
pub use archive::EncodeOpts;
pub use archive::Entry;
pub use archive::EntryKind;
pub use archive::EntryMeta;
pub use archive::OpenOpts;
pub use archive::PlainSink;
pub use archive::Sink;
pub use containment::safe_join;
pub use error::Error;
pub use error::Result;
pub use fidelity::Fidelity;
pub use fidelity::FidelityReport;
pub use fidelity::MetaFields;
pub use fidelity::Rung;
pub use format::CodecCaps;
pub use format::ContainerCaps;
pub use format::CorruptionDetection;
pub use format::FormatId;
pub use format::FormatKind;
pub use format::FormatMeta;
pub use format::MagicRule;
pub use governor::BudgetInputs;
pub use governor::Governor;
pub use governor::LeaseSet;
pub use governor::default_memory_limit;
pub use governor::resolve_workers;
pub use ladder::Resolved;
pub use ladder::StreamPolicy;
pub use ladder::resolve;
pub use probe::Chain;
pub use probe::PROBE_LEN;
pub use probe::chain_for_new_path;
pub use probe::probe;
pub use probe::resolve_chain;
pub use probe::resolve_chain_deep;
pub use probe::resolve_chain_deep_with;
pub use registry::FormatRow;
pub use registry::Registry;
pub use size::format_size;
pub use source::Counting;
pub use source::CountingWriter;
pub use source::DEFAULT_MAX_RATIO;
pub use source::FileSource;
pub use source::PeekSource;
pub use source::RATIO_FLOOR;
pub use source::RatioGuard;
pub use source::ReaderSource;
pub use source::SeekRead;
pub use source::Source;
pub use source::SourceCaps;
pub use source::SpillPolicy;
pub use source::SpillSource;
pub use source::SpillWriter;
pub use source::StreamOnly;

Modules§

archive
The two orthogonal traits, and the entry model they share.
containment
Entry-path containment: the single decision point for whether an archive entry’s name (or a symlink’s target) may be written under a destination directory.
error
fidelity
format
governor
Central resource governance. Nothing in the codebase spawns a thread outside the governor.
ladder
The adaptive stream ladder.
probe
Format detection and pipeline resolution.
registry
Format registry: what this build actually contains.
salvage
The salvage engine: format-agnostic scanning, bounding and collection.
size
Human-readable byte-count rendering.
source
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.

Constants§

VERSION

Functions§

fmt_name
Displays name with every character that could rewrite or hide terminal output escaped: C0 controls and DEL (\0 \t \n \r by name, the rest \xHH), C1 controls (\u{HH}) and the bidi embeddings, overrides and isolates U+202A–U+202E and U+2066–U+2069 (\u{HHHH}). Everything else — backslashes, quotes, spaces, other non-ASCII — is written unchanged, so a name with nothing to escape displays exactly as before. For display only: not reversible, and never used for a name stuffr writes or matches.