Skip to main content

Features and capabilities

Hadris separates three decisions that many crates combine:

  1. Platform support: allocation-free, alloc, or std
  2. I/O mode: sync, async, or both
  3. Capability: read, write, detection, caching, or tooling

Choose each dimension explicitly when disabling default features. Enabling std provides heap allocation, but it does not implicitly select sync or async.

Platform features

ConfigurationAvailable facilitiesTypical targets
No platform featureStack and caller-provided buffers onlyBootloaders, early kernels, small firmware
allocVec, String, owned paths and treesKernels and firmware with a global allocator
stdHosted files, clocks, OS errors, and allocCLI tools, desktop applications, build systems

Not every operation can be allocation-free. Creating filesystem images and holding arbitrary directory trees generally requires alloc; ISO and UDF authoring currently require std.

I/O modes

The sync and async features select parallel API namespaces backed by hadris-io traits. They may be enabled together.

[dependencies]
hadris-fat = {
version = "2.1.0",
default-features = false,
features = ["alloc", "read", "sync", "async", "lfn"]
}

Use hadris_fat::sync and hadris_fat::async explicitly when both modes are enabled. The crate-root re-exports remain available when sync is enabled for backward compatibility.

Some components are intentionally sync-only: FAT caching and analysis tools, the exFAT preview, and the hybrid ISO/UDF writer.

Format capability matrix

CrateFormats or roleReadWrite/createSyncAsyncMinimum for readingStability
hadris-fatFAT12/16/32YesYesYesYesAllocation-freeStable
hadris-fat unstable-exfatexFAT previewPartialPartialYesNoallocExperimental
hadris-partMBR and GPTYesYesYesYesAllocation-freeStable
hadris-isoISO 9660, Joliet, Rock RidgeYesYesYesYesAllocation-freeStable
hadris-udfUDF 1.02YesYesYesYesalloc for filesystem traversalStable
hadris-cpioCPIO newc and CRCYesYesYesYesAllocation-freeStable
hadris-ntfsNTFSYesNoYesYesallocExperimental
hadris-cdHybrid ISO/UDF imagesN/AYesYesNostdStable

“Allocation-free” means the core parser can operate without a global allocator. Higher-level conveniences such as owned filenames, collected directory trees, or image construction may still require alloc.

Common configurations

Bootloader reading FAT

hadris-fat = {
version = "2.1.0",
default-features = false,
features = ["read", "sync"]
}

Kernel with an allocator and async I/O

hadris-iso = {
version = "2.1.0",
default-features = false,
features = ["alloc", "read", "async", "joliet"]
}

Hosted FAT editor

hadris-fat = {
version = "2.1.0",
features = ["cache", "tool"]
}

Allocation-only CPIO writer

hadris-cpio = {
version = "2.1.0",
default-features = false,
features = ["alloc", "read", "write", "sync"]
}

Feature selection rules

  • Select exactly the formats and capabilities the application uses.
  • Select at least one I/O mode for APIs that access storage.
  • Add alloc only when the chosen API returns or stores owned data.
  • Prefer leaf crates when only one format is needed.
  • Treat unstable-exfat and hadris-ntfs as separately versioned experiments.

The workspace CI checks representative allocation-free, alloc, std, sync, async, and combined-mode tiers for every stable format crate.