Skip to main content

Module format_opts

Module format_opts 

Source
Expand description

Filesystem-format options bag.

Every backend’s FormatOpts struct has its own shape — ext cares about block size and journal length, fat32 about volume id and cluster shift, squashfs about compression. The CLI and the TOML spec layer both need a way to ferry those settings through a single type-erased channel:

  • CLI: fstool create --type ext4 -O block_size=4096,sparse=true ./src out.img
  • TOML: [filesystem.options] table with the same key names

OptionMap is that channel. The caller (a parse_format_opts function on each FS) consumes recognised keys with take_u32 / take_bool / take_str etc., then calls OptionMap::check_empty to surface a clear error if the user passed a key the backend doesn’t recognise.

Structs§

OptionMap
A type-erased bag of key=value strings consumed by a backend’s format-options parser. Built from CLI -O flags, a TOML [filesystem.options] table, or both at once.