[][src]Struct arq::tree::Commit

pub struct Commit {
    pub version: u32,
    pub author: String,
    pub comment: String,
    pub parent_commits: ParentCommits,
    pub tree_sha1: String,
    pub tree_encryption_key_stretched: bool,
    pub tree_compression_type: CompressionType,
    pub folder_path: String,
    pub creation_date: Date,
    pub failed_files: Vec<FailedFile>,
    pub has_missing_nodes: bool,
    pub is_complete: bool,
    pub config_plist_xml: Vec<u8>,
    pub arq_version: String,
}

Commit

A "commit" contains the following bytes:

    43 6f 6d 6d 69 74 56 30 31 32      "CommitV012"
    [String:"<author>"]
    [String:"<comment>"]
    [UInt64:num_parent_commits]        (this is always 0 or 1)
    (
        [String:parent_commit_sha1] /* can't be null */
        [Bool:parent_commit_encryption_key_stretched]] /* present for Commit version >= 4 */
    )   /* repeat num_parent_commits times */
    [String:tree_sha1]] /* can't be null */
    [Bool:tree_encryption_key_stretched]] /* present for Commit version >= 4 */
    [Bool:tree_is_compressed] /* present for Commit version 8 and 9 only; indicates Gzip compression or none */
    [CompressionType:tree_compression_type] /* present for Commit version >= 10 */

    [String:"file://<hostname><path_to_folder>"]
    [String:"<merge_common_ancestor_sha1>"] /* only present for Commit version 7 or *older* (was never used) */
    [Bool:is_merge_common_ancestor_encryption_key_stretched] /* only present for Commit version 4 to 7 */
    [Date:creation_date]
    [UInt64:num_failed_files] /* only present for Commit version 3 or later */
    (
        [String:"<relative_path>"] /* only present for Commit version 3 or later */
        [String:"<error_message>"] /* only present for Commit version 3 or later */
    )   /* repeat num_failed_files times */
    [Bool:has_missing_nodes] /* only present for Commit version 8 or later */
    [Bool:is_complete] /* only present for Commit version 9 or later */
    [Data:config_plist_xml] /* a copy of the XML file as described above */
    [String:arq_version] /* the version of the Arq app that created this Commit */

The SHA1 of the most recent Commit is stored in /<computer_uuid>/bucketdata/<folder_uuid>/refs/heads/master appended with a "Y" for historical reasons.

In addition, Arq writes a file in /<computer_uuid>/bucketdata/<folder_uuid>/refs/logs/master each time a new Commit is created (the filename is a timestamp). It's a plist containing the previous and current Commit SHA1s, the SHA1 of the pack file containing the new Commit, and whether the new Commit is a "rewrite" (because the user deleted a backup record for instance).

Fields

version: u32author: Stringcomment: Stringparent_commits: ParentCommitstree_sha1: Stringtree_encryption_key_stretched: booltree_compression_type: CompressionTypefolder_path: Stringcreation_date: Datefailed_files: Vec<FailedFile>has_missing_nodes: boolis_complete: boolconfig_plist_xml: Vec<u8>arq_version: String

Methods

impl Commit[src]

pub fn is_commit(content: &[u8]) -> bool[src]

pub fn new<R: ArqRead>(reader: R) -> Result<Commit>[src]

Auto Trait Implementations

impl Send for Commit

impl Sync for Commit

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self