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;
13mod display;
14pub mod error;
15pub mod fidelity;
16pub mod format;
17pub mod governor;
18#[cfg(any(test, feature = "testing"))]
19mod honesty;
20pub mod ladder;
21pub mod probe;
22pub mod registry;
23pub mod salvage;
24pub mod size;
25pub mod source;
26#[cfg(any(test, feature = "testing"))]
27pub mod testing;
28
29pub use archive::{
30    ArchiveRead, ArchiveWrite, Codec, Container, CreateOpts, DecodeOpts, EncodeOpts, Entry,
31    EntryKind, EntryMeta, OpenOpts, PlainSink, Sink,
32};
33pub use containment::{
34    NameRefusal, SymlinkVerdict, check_symlink_target, classify_symlink_target,
35    name_refused_by_filesystem, safe_join, windows_name_hazard,
36};
37pub use display::fmt_name;
38pub use error::{Error, Result};
39pub use fidelity::{Fidelity, FidelityReport, FidelitySink, MetaFields, Rung};
40pub use format::{
41    CodecCaps, ConfirmFn, ContainerCaps, CorruptionDetection, FormatId, FormatKind, FormatMeta,
42    MagicRule,
43};
44pub use governor::{BudgetInputs, Governor, LeaseSet, default_memory_limit, resolve_workers};
45pub use ladder::{Resolved, StreamPolicy, resolve};
46pub use probe::{
47    Chain, Evidence, Foreign, PROBE_LEN, TAIL_LEN, chain_for_new_path, first_unconfirmed_layer,
48    foreign_from_tail, identify_strict, probe, read_tail, resolve_chain, resolve_chain_checked,
49    resolve_chain_deep, resolve_chain_deep_with,
50};
51pub use registry::{FormatRow, Registry};
52pub use size::format_size;
53pub use source::{
54    BorrowedSource, Counting, CountingWriter, DEFAULT_MAX_RATIO, FileSource, PeekSource,
55    RATIO_FLOOR, RatioGuard, ReaderSource, SeekRead, Source, SourceCaps, SpillPolicy, SpillSource,
56    SpillWriter, StreamOnly, decode_reader,
57};
58
59pub const VERSION: &str = env!("CARGO_PKG_VERSION");