Hadris I/O
No-std I/O abstraction layer for the Hadris filesystem crates.
Overview
This crate provides Read, Write, and Seek traits that work in no-std environments, enabling filesystem implementations to run on bare-metal systems, bootloaders, and embedded devices.
The traits are always this crate's own definitions; enabling the std feature adds blanket implementations for std::io readers, writers, and seekers so they can be used directly. The Error type is intentionally smaller than std::io::Error (no OS error codes; context messages are static strings).
Features
- No-std Compatible - Works without the standard library
- Familiar API - Trait signatures mirror
std::iowhere practical - Zero-copy helpers -
ReadExtstructured reads via bytemuck - In-memory
Cursor- Byte-slice reader/seeker for parsing
Sector-aligned wrappers such as
SectorCursorlive inhadris-fat, not in this crate.
Feature Flags
| Feature | Description | Default |
|---|---|---|
std |
Standard library support; implies alloc |
Yes |
sync |
Synchronous I/O traits | Yes |
async |
Asynchronous I/O traits | No |
alloc |
Currently a no-op; reserved for future use | via std |
std and the I/O mode are independent. Defaults enable both std and sync,
while custom configurations may select sync, async, or both.
Usage
With std (default)
[]
= "2.2.0"
No-std
[]
= { = "2.2.0", = false, = ["sync"] }
Quick Start
use ;
let data = ; // "HDRS"
let mut cursor = new;
let mut buf = ;
cursor.read_exact.unwrap;
assert_eq!;
cursor.seek.unwrap;
cursor.read_exact.unwrap;
assert_eq!;
Core Traits
The traits below are always this crate's own definitions, returning hadris_io::Result. With std, blanket implementations cover any std::io::{Read, Write, Seek} type:
Documentation
License
Licensed under the MIT license.