Expand description
§Hadris Common
Shared types and utilities used across the Hadris filesystem crates.
This crate provides foundational types for working with on-disk filesystem structures, including endian-aware integers, extents, fixed-length filenames, path manipulation, and optical media constants.
§Feature Flags
| Feature | Default | Description |
|---|---|---|
std | yes | Standard library support (CRC, chrono, rand) |
alloc | via std | Heap allocation (String, Vec types) |
bytemuck | yes | Zero-copy serialization for number types |
optical | no | Optical media types for CD/DVD/Blu-ray |
sync | via std | Synchronous I/O (forwarded to hadris-io) |
async | no | Asynchronous I/O (forwarded to hadris-io) |
§Key Types
- Endian numbers:
types::number::U16,types::number::U32,types::number::U64— unsigned integers parameterized by endianness. - Extent:
types::extent::Extent— a contiguous region on disk (sector + length). - FixedFilename:
types::file::FixedFilename— a stack-allocated filename with a compile-time maximum length. - EndianType / Endianness:
types::endian::EndianType,types::endian::Endianness— runtime and compile-time endianness.
§Example
use hadris_common::types::endian::{Endian, LittleEndian};
use hadris_common::types::number::U32;
let value = U32::<LittleEndian>::new(0x12345678);
assert_eq!(value.get(), 0x12345678);Modules§
- alg
- Algorithms (requires std for CRC and random) Utilities for working with algorithms.
- path
- Path utilities Path utilities shared across filesystem implementations.
- str
- Strings (requires alloc for String/Vec)
- types
- Types Contains utility types commonly used for filesystems.
Statics§
- BOOT_
SECTOR_ BIN - A generic 512-byte boot sector binary.