ostrya-core
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.
The object model and the on-disk format primitives of ostree.
A caller reads and writes the objects of an ostree repository as bytes in
the on-disk format and computes their checksums. The crate also holds the
format rules for loose paths, ref names, and new commits. It re-exports the
GVariant codec of ostrya-gvariant for the metadata of a commit. The crate
compiles on Linux, macOS, and Windows.
API documentation: https://docs.rs/ostrya-core
Entry points
Checksumis the SHA-256 id of an object.Commitreads and writes a commit object.DirTreeandDirMetaread and write the objects of a directory.FileHeaderis the header of a content object.Xattrsis a sorted set of extended attributes.ObjectTypeandRepoModeselect theloose_pathof an object.DeflateSinkcompresses the payload of an archive-mode content object.KeyFilereads and writes the repositoryconfigfile.Refis one ref of a repository: local, remote, or collection.RefPatternchecks and matches one ref pattern with*and**.RefSelectorselects ref names with a list of positive and negative patterns.
Modules
base64: standard base64 for byte strings of any length.filehdr: the content-object header, its framing, and its checksum.sizes: the packed entries of theostree.sizescommit metadata.varint: the LEB128 varints of the format.
Examples
use ;
// The root directory of a commit: uid 0, gid 0, mode 0755, no xattrs.
let meta = DirMeta ;
let checksum = sha256;
let hex = "446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488";
assert_eq!;
let path = loose_path;
assert_eq!;