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 size;
23pub mod source;
24#[cfg(any(test, feature = "testing"))]
25pub mod testing;
26
27pub use archive::{
28    ArchiveRead, ArchiveWrite, Codec, Container, CreateOpts, DecodeOpts, EncodeOpts, Entry,
29    EntryKind, EntryMeta, OpenOpts, PlainSink, Sink,
30};
31pub use containment::{check_symlink_target, safe_join};
32pub use error::{Error, Result};
33pub use fidelity::{Fidelity, FidelityReport, MetaFields, Rung};
34pub use format::{
35    CodecCaps, ContainerCaps, CorruptionDetection, FormatId, FormatKind, FormatMeta, MagicRule,
36};
37pub use governor::{BudgetInputs, Governor, LeaseSet, default_memory_limit, resolve_workers};
38pub use ladder::{Resolved, StreamPolicy, resolve};
39pub use probe::{
40    Chain, PROBE_LEN, chain_for_new_path, probe, resolve_chain, resolve_chain_deep,
41    resolve_chain_deep_with,
42};
43pub use registry::{FormatRow, Registry};
44pub use size::format_size;
45pub use source::{
46    Counting, CountingWriter, DEFAULT_MAX_RATIO, FileSource, PeekSource, RATIO_FLOOR, RatioGuard,
47    ReaderSource, SeekRead, Source, SourceCaps, SpillPolicy, SpillSource, StreamOnly,
48};
49
50pub const VERSION: &str = env!("CARGO_PKG_VERSION");