[−][src]Struct arq::tree::Tree
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: u32
xattrs_compression_type: CompressionType
acl_compression_type: CompressionType
xattrs_blob_key: Option<BlobKey>
xattrs_size: u64
acl_blob_key: Option<BlobKey>
uid: i32
gid: i32
mode: i32
mtime_sec: i64
mtime_nsec: i64
flags: i64
finder_flags: i32
extended_finder_flags: i32
st_dev: i32
st_ino: i32
st_nlink: u32
st_rdev: i32
ctime_sec: i64
ctime_nsec: i64
create_time_sec: i64
create_time_nsec: i64
st_blocks: i64
st_blksize: u32
missing_nodes: Vec<String>
nodes: HashMap<String, Node>
Methods
impl Tree
[src]
pub fn new(
compressed_content: &[u8],
compression_type: CompressionType
) -> Result<Tree>
[src]
compressed_content: &[u8],
compression_type: CompressionType
) -> Result<Tree>
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
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self