ostrya-composefs
Ostrya [n. a botanical genus within the family Betulaceae, commonly known as ironwood tree] is a pure-Rust, async implementation of the ostree repository system, written from scratch.
A byte-exact writer of composefs EROFS images, with an fs-verity hasher.
A caller builds a tree of directories, symlinks, and regular files. The
crate writes the EROFS image of the tree and returns the fs-verity digest of
the image. The image is byte-identical to the composefs image of the
ostree command, format version 0. The crate is synchronous and does not
read a repository.
API documentation: https://docs.rs/ostrya-composefs
Entry points
Directoryis the root of a tree, andNodeis one entry of it.Metadataholds the mode, the owner, the mtime, and the xattrs of a node.Contentis the content of aRegularfile: empty or a loose object.build_imagewrites the image into anImagein memory.write_image_towrites the image through a sink and does not keep it.FsVerityHashercalculates an fs-verity digest of a byte stream.Erroris the error of the two image writers.
Examples
use ;
let mut root = new;
let meta = Metadata ;
root.insert;
let image = build_image?;
assert_eq!;
// The streaming writer writes the same bytes and returns the same digest.
let mut sink = Vecnew;
assert_eq!;
assert_eq!;