pub struct Commit {
pub metadata: Value,
pub parent: Option<Checksum>,
pub related: Vec<(String, Vec<u8>)>,
pub subject: String,
pub body: String,
pub timestamp: u64,
pub root_dirtree: Checksum,
pub root_dirmeta: Checksum,
}Expand description
An owned commit object. The timestamp is host-order seconds since the Unix epoch, UTC.
Fields§
§metadata: ValueThe a{sv} metadata dict as a Value tree (an array of two-element
tuples, in on-disk order).
parent: Option<Checksum>Parent commit, None for a root commit (an empty ay on the wire).
Related objects: written as an empty array by the tool; parsed entries are retained verbatim for byte-exact reserialization.
subject: StringThe commit subject, the first line of its message.
body: StringThe commit body, the rest of its message.
timestamp: u64The commit time, in seconds since the Unix epoch, UTC.
root_dirtree: ChecksumThe checksum of the root directory’s dirtree object.
root_dirmeta: ChecksumThe checksum of the root directory’s dirmeta object.
Implementations§
Source§impl Commit
impl Commit
Sourcepub fn serialize(&self) -> Result<Vec<u8>>
pub fn serialize(&self) -> Result<Vec<u8>>
Serialize to normal-form bytes; their SHA-256 is the commit checksum.
Sourcepub fn checksum(&self) -> Result<Checksum>
pub fn checksum(&self) -> Result<Checksum>
The commit checksum: SHA-256 of the serialized bytes.
Sourcepub fn content_checksum(&self) -> Checksum
pub fn content_checksum(&self) -> Checksum
The commit content checksum: SHA-256 over the binary root dirtree and dirmeta checksums, a content identity independent of commit metadata and timestamp.
Sourcepub fn metadata_value(&self, key: &str) -> Option<&Value>
pub fn metadata_value(&self, key: &str) -> Option<&Value>
The variant value stored under key in the metadata dict.
Sourcepub fn version(&self) -> Option<&str>
pub fn version(&self) -> Option<&str>
The version metadata key (the only well-known key without the
ostree. prefix).
Sourcepub fn ref_bindings(&self) -> Vec<&str>
pub fn ref_bindings(&self) -> Vec<&str>
The refs named by ostree.ref-binding, empty when unbound.
Sourcepub fn collection_binding(&self) -> Option<&str>
pub fn collection_binding(&self) -> Option<&str>
The ostree.collection-binding metadata key.
Trait Implementations§
impl Eq for Commit
Source§impl GvType for Commit
impl GvType for Commit
Source§const SIGNATURE: &'static str = "(a{sv}aya(say)sstayay)"
const SIGNATURE: &'static str = "(a{sv}aya(say)sstayay)"
Source§const FIXED_SIZE: Option<usize> = None
const FIXED_SIZE: Option<usize> = None
None.