1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! `ferrosys` — pure-Rust, userspace filesystem tooling.
//!
//! The crate creates and reads filesystem images entirely in userspace, over ordinary byte
//! streams, in self-contained, safe Rust. On-disk types serialize through explicit
//! little-endian byte accessors, so the byte layout is spelled out at every field.
//!
//! # Structure
//!
//! The crate root holds the family-agnostic substrate — the vocabulary a detector and a
//! scan speak, independent of which family answers them:
//!
//! - [`detect`] reads an image and reports the [`Filesystem`] family it holds, and
//! [`detect_with`] does the same at an offset within the source, for a partition or a
//! region a carver located; [`DetectError`] tells an unreadable source from an
//! unrecognized one.
//! - [`crc32c`] is the reflected CRC-32C primitive filesystem metadata checksums are
//! built from.
//!
//! # Features
//!
//! `ext` is on by default and is the whole filesystem surface. Three more are off by
//! default, so a build that wants none of them depends only on `thiserror`:
//!
//! - **`tar`** adds the tar/PAX archive source and sink: a filesystem built from an
//! archive, and one written back out as one. It depends on `tar`.
//! - **`dir`** adds the host-directory source: a filesystem built by walking a tree on
//! this machine, with its modes, ownership, times, hard links, special files, and
//! extended attributes. It depends on `rustix` for the two extended-attribute calls the
//! standard library has no equivalent of, and is present on Linux.
//! - **`serde`** adds `Serialize` to the scan taxonomy, the planned geometry, and the
//! feature model, for embedding them in a document of your own. It depends on `serde`.
// The crate is safe by construction: on-disk types serialize through explicit
// little-endian byte accessors, never transmutes or `zerocopy`.
/// The crate's README, compiled as a doctest so the example on its front page is the
/// example this crate's API actually accepts. The item exists only while rustdoc is
/// collecting doctests, so it is neither part of the crate nor part of its documentation.
;
// ── Generic substrate: the crate root ──
//
// Present regardless of which family backends are enabled. The root exposes only what a
// detector or a scan produces independent of the family that answers it.
// The reflected CRC-32C primitive. The module is pure and has no family dependencies.
pub use crc32c;
// Image detection and the family selector it returns. `Filesystem` and `DetectError` are
// always present; `detect` dispatches across whichever families are compiled in.
pub use ;
// ── The ext family: the `ext` module, behind the default-on `ext` feature ──
//
// The family's modules live at the crate root as private modules — so their cross-module
// paths stay `crate::` — and are presented to callers only through [`ext`]. The feature
// model, the checksum seam, and the scan taxonomy are ext concepts: they are reached
// through `ext`, not the crate root.