Entry

Struct Entry 

Source
pub struct Entry { /* private fields */ }
Expand description

An entry in the mtree file.

Entries have a path to the entity in question, and a list of optional params.

Implementations§

Source§

impl Entry

Source

pub fn path(&self) -> &Path

The path of this entry

Source

pub fn checksum(&self) -> Option<u64>

cksum The checksum of the file using the default algorithm specified by the cksum(1) utility.

Source

pub fn device(&self) -> Option<&Device>

device The device number for block or char file types.

Source

pub fn contents(&self) -> Option<&Path>

contents The full pathname of a file that holds the contents of this file.

Source

pub fn flags(&self) -> Option<&[u8]>

flags The file flags as a symbolic name.

Source

pub fn gid(&self) -> Option<u32>

gid The file group as a numeric value.

Source

pub fn gname(&self) -> Option<&[u8]>

gname The file group as a symbolic name.

The name can be up to 32 chars and must match regex [a-z_][a-z0-9_-]*[$]?.

Source

pub fn ignore(&self) -> bool

ignore Ignore any file hierarchy below this line.

Source

pub fn inode(&self) -> Option<u64>

inode The inode number.

link The target of the symbolic link when type=link.

Source

pub fn md5(&self) -> Option<u128>

md5|md5digest The MD5 message digest of the file.

Source

pub fn mode(&self) -> Option<FileMode>

mode The current file’s permissions as a numeric (octal) or symbolic value.

nlink The number of hard links the file is expected to have.

Source

pub fn no_change(&self) -> bool

nochange Make sure this file or directory exists but otherwise ignore all attributes.

Source

pub fn optional(&self) -> bool

optional The file is optional; do not complain about the file if it is not in the file hierarchy.

Source

pub fn resident_device(&self) -> Option<&Device>

resdevice The “resident” device number of the file, e.g. the ID of the device that contains the file. Its format is the same as the one for device.

Source

pub fn rmd160(&self) -> Option<&[u8; 20]>

rmd160|rmd160digest|ripemd160digest The RIPEMD160 message digest of the file.

Source

pub fn sha1(&self) -> Option<&[u8; 20]>

sha1|sha1digest The FIPS 160-1 (“SHA-1”) message digest of the file.

Source

pub fn sha256(&self) -> Option<&[u8; 32]>

sha256|sha256digest The FIPS 180-2 (“SHA-256”) message digest of the file.

Source

pub fn sha384(&self) -> Option<&[u8; 48]>

sha384|sha384digest The FIPS 180-2 (“SHA-384”) message digest of the file.

Source

pub fn sha512(&self) -> Option<&[u8; 64]>

sha512|sha512digest The FIPS 180-2 (“SHA-512”) message digest of the file.

Source

pub fn size(&self) -> Option<u64>

size The size, in bytes, of the file.

Source

pub fn time(&self) -> Option<SystemTime>

time The last modification time of the file.

Source

pub fn file_type(&self) -> Option<FileType>

type The type of the file.

Source

pub fn uid(&self) -> Option<u32>

The file owner as a numeric value.

Source

pub fn uname(&self) -> Option<&[u8]>

The file owner as a symbolic name.

The name can be up to 32 chars and must match regex [a-z_][a-z0-9_-]*[$]?.

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Entry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Entry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Entry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Entry

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Entry

Source§

fn cmp(&self, other: &Entry) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Entry

Source§

fn eq(&self, other: &Entry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Entry

Source§

fn partial_cmp(&self, other: &Entry) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Entry

Source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.