ostrya-gvariant
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 GVariant codec for the ostree on-disk format.
A caller writes values as GVariant bytes in normal form and reads them back. The checksum of each ostree metadata object is the hash of these bytes, so each metadata checksum of ostrya depends on this crate. The typed codec reads fields in place with no allocation. The crate has no ostree knowledge.
API documentation: https://docs.rs/ostrya-gvariant
Entry points
Type::parsereads a type signature.to_byteswrites aValueas normal-form bytes.from_bytesreads normal-form bytes as aValue.GvEncodewrites a Rust type as normal-form bytes.GvDecodereads a Rust type in place from normal-form bytes.to_textwrites the GVariant text form of a value.from_textreads the GVariant text form.DictBuilderbuilds ana{sv}dict.
Examples
use ;
let ty = parse?;
let value = Tuple;
let bytes = to_bytes?;
// The string, one padding byte, the `u`, and the framing offset 7.
assert_eq!;
assert_eq!;