[][src]Struct arq::tree::Tree

pub struct Tree {
    pub version: u32,
    pub xattrs_compression_type: CompressionType,
    pub acl_compression_type: CompressionType,
    pub xattrs_blob_key: Option<BlobKey>,
    pub xattrs_size: u64,
    pub acl_blob_key: Option<BlobKey>,
    pub uid: i32,
    pub gid: i32,
    pub mode: i32,
    pub mtime_sec: i64,
    pub mtime_nsec: i64,
    pub flags: i64,
    pub finder_flags: i32,
    pub extended_finder_flags: i32,
    pub st_dev: i32,
    pub st_ino: i32,
    pub st_nlink: u32,
    pub st_rdev: i32,
    pub ctime_sec: i64,
    pub ctime_nsec: i64,
    pub create_time_sec: i64,
    pub create_time_nsec: i64,
    pub st_blocks: i64,
    pub st_blksize: u32,
    pub missing_nodes: Vec<String>,
    pub nodes: HashMap<String, Node>,
}

Tree

A tree contains the following bytes:

    54 72 65 65 56 30 32 32             "TreeV022"
    [Bool:xattrs_are_compressed] /* present for Tree versions 12-18 */
    [CompressionType:xattrs_compression_type] /* present for Tree version >= 19; indicates Gzip compression or none */
    [Bool:acl_is_compressed] /* present for Tree versions 12-18 */
    [CompressionType:acl_compression_type] /* present for Tree version >= 19; indicates Gzip compression or none */
    [Int32:xattrs_compression_type] /* present for Tree version >= 20; older Trees are gzip compression type */
    [Int32:acl_compression_type] /* present for Tree version >= 20; older Trees are gzip compression type */
    [BlobKey:xattrs_blob_key] /* null if directory has no xattrs */
    [UInt64:xattrs_size]
    [BlobKey:acl_blob_key] /* null if directory has no acl */
    [Int32:uid]
    [Int32:gid]
    [Int32:mode]
    [Int64:mtime_sec]
    [Int64:mtime_nsec]
    [Int64:flags]
    [Int32:finderFlags]
    [Int32:extendedFinderFlags]
    [Int32:st_dev]
    [Int32:st_ino]
    [UInt32:st_nlink]
    [Int32:st_rdev]
    [Int64:ctime_sec]
    [Int64:ctime_nsec]
    [Int64:st_blocks]
    [UInt32:st_blksize]
    [UInt64:aggregate_size_on_disk] /* only present for Tree version 11 to 16 (never used) */
    [Int64:create_time_sec] /* only present for Tree version 15 or later */
    [Int64:create_time_nsec] /* only present for Tree version 15 or later */
    [UInt32:missing_node_count] /* only present for Tree version 18 or later */
    (
        [String:"<missing_node_name>"] /* only present for Tree version 18 or later */
    )   /* repeat <missing_node_count> times */
    [UInt32:node_count]
    (
        [String:"<file name>"] /* can't be null */
        [Node]
    )   /* repeat <node_count> times */

Fields

version: u32xattrs_compression_type: CompressionTypeacl_compression_type: CompressionTypexattrs_blob_key: Option<BlobKey>xattrs_size: u64acl_blob_key: Option<BlobKey>uid: i32gid: i32mode: i32mtime_sec: i64mtime_nsec: i64flags: i64finder_flags: i32extended_finder_flags: i32st_dev: i32st_ino: i32st_nlink: u32st_rdev: i32ctime_sec: i64ctime_nsec: i64create_time_sec: i64create_time_nsec: i64st_blocks: i64st_blksize: u32missing_nodes: Vec<String>nodes: HashMap<String, Node>

Methods

impl Tree[src]

pub fn new(
    compressed_content: &[u8],
    compression_type: CompressionType
) -> Result<Tree>
[src]

Reading a tree

Note: Usually one reads this from a file, not used directly like shown here.

let tree_bytes = [0, 0, 2, 182, 159, 84, 114, 101, 101, 86, 48, 50, 50, 0, 1, 0, 30, 255, 11, 1, 245, 0, 0, 0, 20, 0, 0, 65, 237, 0, 0, 0, 0, 92, 197, 219, 103, 0, 0, 0, 0, 16, 90, 33, 177, 75, 0, 1, 132, 2, 77, 81, 191, 0, 0, 0, 4, 28, 0, 15, 48, 0, 3, 17, 16, 31, 0, 193, 92, 197, 219, 84, 0, 0, 0, 0, 48, 246, 52, 114, 17, 0, 67, 0, 0, 2, 1, 9, 0, 145, 8, 115, 111, 109, 101, 102, 105, 108, 101, 16, 0, 17, 2, 6, 0, 2, 2, 0, 20, 1, 35, 0, 244, 30, 40, 100, 97, 56, 97, 48, 48, 51, 53, 55, 54, 52, 51, 100, 52, 56, 49, 98, 53, 98, 52, 54, 99, 57, 100, 99, 57, 99, 52, 49, 50, 55, 55, 98, 51, 53, 98, 57, 101, 56, 53, 1, 0, 0, 0, 53, 0, 6, 2, 0, 22, 12, 11, 0, 15, 2, 0, 13, 4, 3, 1, 41, 129, 164, 3, 1, 60, 92, 158, 217, 58, 0, 5, 103, 0, 5, 9, 0, 146, 0, 1, 0, 0, 4, 2, 77, 81, 220, 11, 0, 2, 2, 0, 5, 22, 1, 3, 67, 0, 5, 16, 0, 50, 89, 212, 77, 34, 0, 85, 0, 8, 0, 0, 16, 182, 0, 177, 10, 116, 111, 112, 95, 102, 111, 108, 100, 101, 114, 89, 0, 15, 16, 1, 3, 255, 25, 99, 48, 53, 55, 49, 53, 51, 55, 100, 53, 55, 100, 57, 52, 56, 56, 49, 54, 52, 51, 48, 51, 57, 53, 48, 100, 102, 100, 101, 100, 53, 99, 98, 54, 99, 102, 99, 100, 50, 48, 16, 1, 3, 19, 39, 121, 0, 15, 2, 0, 116, 80, 0, 0, 0, 0, 0];
let tree = arq::tree::Tree::new(&tree_bytes, arq::compression::CompressionType::LZ4).unwrap();
assert_eq!(tree.version, 22);

Auto Trait Implementations

impl Send for Tree

impl Sync for Tree

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