Struct cap_std::fs::Metadata[][src]

pub struct Metadata { /* fields omitted */ }

Metadata information about a file.

This corresponds to std::fs::Metadata.

We need to define our own version because the libstd `Metadata` doesn't have a public constructor that we can use.

Implementations

impl Metadata[src]

pub fn from_file(file: &File) -> Result<Metadata, Error>[src]

Constructs a new instance of Self from the given std::fs::File.

pub fn from_just_metadata(std: Metadata) -> Metadata[src]

Constructs a new instance of Self from the given std::fs::Metadata.

As with the comments in std::fs::Metadata::volume_serial_number and nearby functions, some fields of the resulting metadata will be None.

pub const fn file_type(&self) -> FileType[src]

Returns the file type for this metadata.

This corresponds to std::fs::Metadata::file_type.

pub fn is_dir(&self) -> bool[src]

Returns true if this metadata is for a directory.

This corresponds to std::fs::Metadata::is_dir.

pub fn is_file(&self) -> bool[src]

Returns true if this metadata is for a regular file.

This corresponds to std::fs::Metadata::is_file.

pub const fn len(&self) -> u64[src]

Returns the size of the file, in bytes, this metadata is for.

This corresponds to std::fs::Metadata::len.

pub fn permissions(&self) -> Permissions[src]

Returns the permissions of the file this metadata is for.

This corresponds to std::fs::Metadata::permissions.

pub fn modified(&self) -> Result<SystemTime, Error>[src]

Returns the last modification time listed in this metadata.

This corresponds to std::fs::Metadata::modified.

pub fn accessed(&self) -> Result<SystemTime, Error>[src]

Returns the last access time of this metadata.

This corresponds to std::fs::Metadata::accessed.

pub fn created(&self) -> Result<SystemTime, Error>[src]

Returns the creation time listed in this metadata.

This corresponds to std::fs::Metadata::created.

Trait Implementations

impl Clone for Metadata[src]

pub fn clone(&self) -> Metadata[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Metadata[src]

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

Formats the value using the given formatter. Read more

impl MetadataExt for Metadata[src]

pub fn file_attributes(&self) -> u32[src]

Returns the value of the dwFileAttributes field of this metadata. Read more

pub fn creation_time(&self) -> u64[src]

Returns the value of the ftCreationTime field of this metadata. Read more

pub fn last_access_time(&self) -> u64[src]

Returns the value of the ftLastAccessTime field of this metadata. Read more

pub fn last_write_time(&self) -> u64[src]

Returns the value of the ftLastWriteTime field of this metadata. Read more

pub fn file_size(&self) -> u64[src]

Returns the value of the nFileSize{High,Low} fields of this metadata. Read more

pub fn volume_serial_number(&self) -> Option<u32>[src]

🔬 This is a nightly-only experimental API. (windows_by_handle)

Returns the value of the dwVolumeSerialNumber field of this metadata. Read more

🔬 This is a nightly-only experimental API. (windows_by_handle)

Returns the value of the nNumberOfLinks field of this metadata. Read more

pub fn file_index(&self) -> Option<u64>[src]

🔬 This is a nightly-only experimental API. (windows_by_handle)

Returns the value of the nFileIndex{Low,High} fields of this metadata. Read more

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.

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

Performs the conversion.

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.

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

Performs the conversion.