pub struct Metadata { /* private fields */ }Expand description
A container for the UnixFs metadata, which can be present at the root of the file, directory, or symlink trees.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn mode(&self) -> Option<u32>
pub fn mode(&self) -> Option<u32>
Returns the full file mode, if one has been specified.
The full file mode is originally read through st_mode field of stat struct defined in
sys/stat.h and its defining OpenGroup standard. The lowest 3 bytes correspond to read,
write, and execute rights per user, group, and other, while the 4th byte determines sticky bits,
set user id or set group id. The following two bytes correspond to the different file types, as
defined by the same OpenGroup standard:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
Sourcepub fn mtime(&self) -> Option<(i64, u32)>
pub fn mtime(&self) -> Option<(i64, u32)>
Returns the raw timestamp of last modification time, if specified.
The timestamp is (seconds, nanos) - similar to core::time::Duration, with the exception of
allowing seconds to be negative. The seconds are calculated from 1970-01-01 00:00:00 or
the common “unix epoch”.
Sourcepub fn mtime_as_filetime(&self) -> Option<FileTime>
pub fn mtime_as_filetime(&self) -> Option<FileTime>
Returns the mtime metadata as a FileTime. Enabled only in the filetime feature.
Trait Implementations§
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more