Skip to main content
Version: 3.0.0-rc.2

Getting started with 3.0.0-rc.2

Use hadris for a single dependency that reaches the format drivers, shared filesystem API, block devices and stream adapters. Disable defaults to choose only the formats and I/O mode the application needs.

Get the release candidate​

These pages target 3.0.0-rc.2. For registry installation after publication, select the release candidate explicitly. Before publication, or when testing development changes, use the source checkout below:

[dependencies.hadris]
version = "3.0.0-rc.2"
default-features = false
features = ["std", "sync", "fat"]

A plain version = "3" cannot select a prerelease. The recipes in these guides use the explicit RC2 version. For development snapshots, use a Git dependency pinned to a reviewed rev.

After publication, install the command-line tool with cargo-binstall:

cargo binstall hadris-cli --version 3.0.0-rc.2
hadris --help

Or compile it with Rust 1.88 or newer:

cargo install hadris-cli --version 3.0.0-rc.2 --locked
hadris --help

For source examples and the CLI:

git clone https://github.com/hxyulin/hadris.git
cd hadris
cargo run --locked -p hadris-example-migrate-v3
cargo run --locked -p hadris-cli -- --help

The migration example builds its own FAT and ISO images and verifies path handles, generic filesystem reads and the allocation-free FAT API. It needs no input or external image tools.

Read a FAT image​

use hadris::fat::sync::FatFs;
use hadris::fs::MountOptions;
use hadris::fs::sync::Volume;
use hadris::host::FileDevice;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let device = FileDevice::open("disk.img")?;
let fs = FatFs::mount(device, MountOptions::new().read_only())?;
let volume = Volume::new(fs);
for entry in volume.read_dir("/")? {
println!("{}", String::from_utf8_lossy(entry?.name().as_bytes()));
}
Ok(())
}

hadris::fat, hadris::fs, hadris::storage and hadris::io are re-exports of the same public APIs offered by the individual crates. The umbrella does not require detection or additional formats when defaults are disabled. Choose individual crates when managing those dependencies and versions directly is useful.

Pick the interface and features​

ApplicationFeatures on hadrisInterface
Host FAT reader/editorstd, sync, fatfat::sync::FatFs and fs::sync::Volume
Host FAT formatterAdd writefat::sync::format or write
Unknown host imagestd, sync, detect; add part for partition operationshost::open or sync::detect
Allocator-equipped FAT kernelalloc, sync, fatBare FileSystem driver; sync Volume requires std
Allocated async FATalloc, async, fatfat::r#async::FatFs and async Volume
Allocation-free FAT firmwaresync, fatfat::embedded::sync::Fat; 512-byte device blocks
Allocation-free ISO/UDF readersync, iso or udfBare FileSystem driver
Streaming CPIOsync, cpio; add alloc for writingcpio::sync::CpioReader or Writer

std implies alloc, but neither selects an I/O mode. write adds FAT and exFAT formatting; ordinary file mutation is already available in their drivers. Reading is always compiled in stable format crates. The APFS preview retains its read feature internally.

Use Volume for paths and handles, and the bare FileSystem trait for node operations and platform integrations. Close written files and explicitly unmount when errors from metadata publication or device flush must be reported. RC2 uses one driver for local and Send devices; operation state must also be Send for Send futures. See async support boundaries.

Next steps​