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.
When the std feature is enabled, traits re-export from std::io. In no_std mode, a minimal custom trait surface is provided. The no-std Error type is intentionally smaller than std::io::Error (no OS error codes; message storage requires alloc).
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 sync, alloc) |
Yes |
sync |
Synchronous I/O traits | Yes |
async |
Asynchronous I/O traits | No |
alloc |
Heap allocation (dynamic error messages in no-std) | via std |
Usage
With std (default)
[]
= "2.0.0-rc.2"
No-std
[]
= { = "2.0.0-rc.2", = 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
With std, these are std::io::{Read, Write, Seek}. Without std, this crate defines compatible traits returning hadris_io::Result:
License
Licensed under the MIT license.