Skip to main content

Attrs

Struct Attrs 

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

Idiomatic metadata returned by the Rust-native path API.

Implementations§

Source§

impl Attrs

Source

pub fn returned_attributes(&self) -> AttrMask

Attribute fields actually returned by the backend, not merely requested.

Optional accessors remain None when a field was not requested or the backend could not provide it. Check this mask before projecting the metadata into an API that requires concrete values (such as stat).

Source

pub fn missing_attributes(&self, requested: AttrMask) -> AttrMask

Requested fields that were not returned by the backend.

Source

pub fn has_attributes(&self, requested: AttrMask) -> bool

Whether every field in requested was returned by the backend.

Source

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

Full POSIX mode, including the file type bits, when returned.

Source

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

Number of allocated 512-byte blocks, when returned.

Source

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

Device identifier for a special file, when returned.

Source

pub fn has_named_attributes(&self) -> Option<bool>

Whether named attributes exist, when the backend supplied this field.

Source

pub fn file_type(&self) -> VfType

Source

pub fn is_file(&self) -> bool

Source

pub fn is_dir(&self) -> bool

Source

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

Logical size, when SIZE was returned. Missing is distinct from zero.

Source

pub fn is_empty(&self) -> Option<bool>

Source

pub fn permissions(&self) -> Option<Permissions>

Permission bits, when MODE was returned. Missing is distinct from mode zero.

Source

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

Source

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

Source

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

POSIX status-change time; this is not a creation timestamp.

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for Attrs

Source§

fn clone(&self) -> Attrs

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Attrs

Source§

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

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

impl Eq for Attrs

Source§

impl PartialEq for Attrs

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Attrs

Auto Trait Implementations§

§

impl Freeze for Attrs

§

impl RefUnwindSafe for Attrs

§

impl Send for Attrs

§

impl Sync for Attrs

§

impl Unpin for Attrs

§

impl UnsafeUnpin for Attrs

§

impl UnwindSafe for Attrs

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.