Skip to main content

stuffr_core/
lib.rs

1//! Core abstractions for the `stuffr` toolkit.
2//!
3//! This crate deliberately depends on **no** compression format crate. That
4//! constraint is what makes the stream ladder and the thread governor testable
5//! against mock formats, with no C toolchain and no real archives.
6
7pub mod archive;
8#[cfg(feature = "testing")]
9pub mod conformance;
10#[cfg(feature = "testing")]
11mod container_conformance;
12pub mod containment;
13pub mod error;
14pub mod fidelity;
15pub mod format;
16pub mod governor;
17#[cfg(any(test, feature = "testing"))]
18mod honesty;
19pub mod ladder;
20pub mod probe;
21pub mod registry;
22pub mod salvage;
23pub mod size;
24pub mod source;
25#[cfg(any(test, feature = "testing"))]
26pub mod testing;
27
28pub use archive::{
29    ArchiveRead, ArchiveWrite, Codec, Container, CreateOpts, DecodeOpts, EncodeOpts, Entry,
30    EntryKind, EntryMeta, OpenOpts, PlainSink, Sink,
31};
32pub use containment::{check_symlink_target, safe_join};
33pub use error::{Error, Result};
34pub use fidelity::{Fidelity, FidelityReport, MetaFields, Rung};
35pub use format::{
36    CodecCaps, ContainerCaps, CorruptionDetection, FormatId, FormatKind, FormatMeta, MagicRule,
37};
38pub use governor::{BudgetInputs, Governor, LeaseSet, default_memory_limit, resolve_workers};
39pub use ladder::{Resolved, StreamPolicy, resolve};
40pub use probe::{
41    Chain, PROBE_LEN, chain_for_new_path, probe, resolve_chain, resolve_chain_deep,
42    resolve_chain_deep_with,
43};
44pub use registry::{FormatRow, Registry};
45pub use size::format_size;
46pub use source::{
47    Counting, CountingWriter, DEFAULT_MAX_RATIO, FileSource, PeekSource, RATIO_FLOOR, RatioGuard,
48    ReaderSource, SeekRead, Source, SourceCaps, SpillPolicy, SpillSource, StreamOnly,
49};
50
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");