Skip to main content

hadris/
lib.rs

1//! # Hadris
2//!
3//! **The Rust storage stack.**
4//!
5//! Hadris is a pure Rust toolkit for block devices, partition tables,
6//! filesystems, archives, and disk images. Its feature model supports desktop
7//! applications and `no_std` bootloaders, kernels, firmware, and embedded
8//! systems.
9//!
10//! The umbrella crate groups the individual libraries by storage access model:
11//!
12//! - [`block`] — block filesystems and partition tables
13//! - [`optical`] — optical filesystems and disc image composition
14//! - [`archive`] — sequential archive formats
15//! - [`path`] — lexical virtual-path parsing and normalization
16//! - [`fixed`] — fixed-capacity byte and text types
17//!
18//! # Feature flags
19//!
20//! Leaf features (`storage`, `fat`, `part`, `iso`, `udf`, `cd`, and `cpio`) enable one
21//! library at a time. The `block`, `optical`, and `archive` features enable all
22//! libraries in their respective category. Platform (`std`, `alloc`), I/O mode
23//! (`sync`, `async`), and capability (`read`, `write`) features are forwarded
24//! independently to enabled leaves. The default set is the hosted synchronous
25//! read/write configuration with `fat`, `iso`, and `cpio`.
26//!
27//! Hybrid CD image creation is currently sync-only. Enabling `cd`—directly or
28//! through `optical`—therefore enables the CD writer's sync API, even when the
29//! umbrella `async` feature is also selected. ISO and UDF still expose their
30//! async modules in that configuration.
31//!
32//! # Quick start
33//!
34//! ```rust,no_run
35//! use hadris::optical::iso::sync::IsoImage;
36//!
37//! let file = std::fs::File::open("image.iso").unwrap();
38//! let iso = IsoImage::open(file).unwrap();
39//! let pvd = iso.read_pvd().unwrap();
40//! println!("Volume: {}", pvd.volume_identifier);
41//! ```
42
43#![deny(missing_docs)]
44
45/// Block-oriented storage, filesystems, and disk-layout formats.
46#[cfg(any(feature = "storage", feature = "fat", feature = "part"))]
47pub use hadris_block as block;
48
49/// Optical filesystems and disc-image composition.
50#[cfg(any(feature = "iso", feature = "udf", feature = "cd"))]
51pub use hadris_optical as optical;
52
53/// Sequential archive formats.
54#[cfg(feature = "cpio")]
55pub use hadris_archive as archive;
56
57/// Lexical virtual-path utilities.
58#[cfg(feature = "path")]
59pub use hadris_path as path;
60
61/// Fixed-capacity byte and text types.
62#[cfg(feature = "fixed")]
63pub use hadris_fixed as fixed;