Hadris Common
Shared types and utilities used by Hadris filesystem crates.
Overview
This crate provides common functionality needed across the Hadris workspace,
including endian-aware types, extents, and optional optical-media types. New
fixed-capacity buffers and text should use hadris-fixed, and new path code
should use hadris-path; the old modules remain as deprecated compatibility
forwarding surfaces.
Features
- Endian Types - Little-endian and big-endian wrappers for integers
- Extents - On-disk layout helpers used by ISO and related crates
- CRC / time / rand - Available under the
stdfeature - Optical media - Session and metadata helpers behind the
opticalfeature - No-std Compatible - Works without the standard library
Feature Flags
| Feature | Description | Default |
|---|---|---|
std |
Standard library support (CRC, chrono, rand; implies sync, alloc) |
Yes |
alloc |
Heap allocation without full std | via std |
bytemuck |
Zero-copy serialization support | Yes |
optical |
Optical media types (SessionInfo, metadata writers) |
No |
sync |
Synchronous I/O feature forwarded to hadris-io (for dependents) |
via std |
async |
Asynchronous I/O feature forwarded to hadris-io |
No |
sync/asyncenable the matchinghadris-iofeatures for crates that depend onhadris-common. This crate does not re-exporthadris-iotraits at the root.
Usage
Endian Types
use LittleEndian;
use U32;
let value = U32::new;
assert_eq!;
Boot sector binary
assert_eq!;
assert_eq!;
assert_eq!;
For No-std Environments
[]
= { = "2.0.0-rc.2", = false, = ["alloc", "bytemuck"] }
Minimal (No Heap)
[]
= { = "2.0.0-rc.2", = false, = ["bytemuck"] }
License
Licensed under the MIT license.