pub struct ServerCommit {
pub branch: String,
pub tags: Vec<String>,
pub bind_refs: Vec<String>,
pub root_dirtree: Checksum,
pub root_dirmeta: Checksum,
pub subject: String,
pub body: String,
pub metadata: Vec<(String, Vec<u8>)>,
pub related: Vec<(String, Checksum)>,
pub timestamp: Option<u64>,
pub orphan: bool,
}Expand description
A commit that the server makes from a tree and the fields that the client
sends, the value of the server-commit key of a Commit.
The value has the type (sasas(ayay)ssa{sv}a(say)a{sv}). Its members hold the
fields in the order of this struct. The root dirtree and the root dirmeta
make one (ayay) member. timestamp and
orphan are keys of the last member, a dict of options.
The server reads the tip of the branch under its update lock, and writes
the commit with that tip as its parent. It moves the branch and creates
each tag at the new commit. The CommitReply of a server commit holds
one entry for the branch, then one entry for each tag. The new commit of
each entry is the commit that the server wrote.
Fields§
§branch: StringThe branch that the server moves to the new commit: NAME or
@ID:NAME.
The tags that the server creates at the new commit, in order, each
NAME or @ID:NAME.
The branch and each tag are in one namespace, after the server reads
@ID: with ID its own collection id as a local ref.
bind_refs: Vec<String>The names that the commit binds and that get no ref, in order, each a
plain NAME.
The ostree.ref-binding of the commit holds the name part of the
branch and of each tag, and each of these names.
root_dirtree: ChecksumThe checksum of the root dirtree of the commit.
root_dirmeta: ChecksumThe checksum of the root dirmeta of the commit.
subject: StringThe subject of the commit.
body: StringThe body of the commit.
metadata: Vec<(String, Vec<u8>)>The metadata entries of the client, in order.
Each entry is a key and the bytes of a v in normal form: the bytes
of the value, a zero byte, and the type signature of the value.
to_bytes with Type::Variant gives
these bytes. The dict is data, and the rules of a protocol dict do not
apply to it: the decoder keeps each entry in order, also a key that
occurs two times. The decoder and the encoder check the bytes of each
entry and build no value tree.
The attachments of the commit, in the order of the client: field 2 of the commit.
Each entry is a name and the checksum of a commit. The member has the
type a(say), with the 32 bytes of each checksum. The encoder and the
decoder refuse an entry with an empty name. The decoder refuses a
checksum that is not 32 bytes. Both keep two entries with one name, and
the server refuses them. The server writes the entries sorted by name
in byte order.
timestamp: Option<u64>The commit time in seconds since the Unix epoch, UTC, under the key
timestamp.
None gives the clock of the server. The encoder writes the key only
if the value is Some.
orphan: boolThe flag that makes a commit with no parent, under the key orphan.
The encoder writes the key only if the value is true, and the
decoder reads an absent key as false.
Trait Implementations§
Source§impl Clone for ServerCommit
impl Clone for ServerCommit
Source§impl Debug for ServerCommit
impl Debug for ServerCommit
impl Eq for ServerCommit
Source§impl PartialEq for ServerCommit
impl PartialEq for ServerCommit
impl StructuralPartialEq for ServerCommit
Auto Trait Implementations§
impl Forget for ServerCommit
impl Freeze for ServerCommitwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<(String, Vec<u8>)>: Freeze,
PhantomData<(String, Checksum)>: Freeze,
impl Move for ServerCommit
impl RefUnwindSafe for ServerCommit
impl Send for ServerCommitwhere
RawVecInner: Send,
impl Sync for ServerCommitwhere
RawVecInner: Sync,
impl Unpin for ServerCommit
impl UnsafeUnpin for ServerCommitwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, Vec<u8>)>: UnsafeUnpin,
PhantomData<(String, Checksum)>: UnsafeUnpin,
impl UnwindSafe for ServerCommitwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.