pub struct FileAttributes {
pub size: Option<u64>,
pub uid: Option<u32>,
pub user: Option<String>,
pub gid: Option<u32>,
pub group: Option<String>,
pub permissions: Option<u32>,
pub atime: Option<u32>,
pub mtime: Option<u32>,
}Expand description
Used in the implementation of other packets.
Implements most Metadata methods
The fields user and group are string names of users and groups for
clients that can be displayed in longname. Can be omitted.
The flags field is omitted because it is set by itself depending on the fields
Fields§
§size: Option<u64>§uid: Option<u32>§user: Option<String>§gid: Option<u32>§group: Option<String>§permissions: Option<u32>§atime: Option<u32>§mtime: Option<u32>Implementations§
Source§impl FileAttributes
impl FileAttributes
Sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
Returns true if is a
regular
Sourcepub fn set_regular(&mut self, is_regular: bool)
pub fn set_regular(&mut self, is_regular: bool)
Set flag if is a regular or not
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Returns true if is a
symlink
Sourcepub fn set_symlink(&mut self, is_symlink: bool)
pub fn set_symlink(&mut self, is_symlink: bool)
Set flag if is a symlink or not
Sourcepub fn is_character(&self) -> bool
pub fn is_character(&self) -> bool
Returns true if is a
character
Sourcepub fn set_character(&mut self, is_character: bool)
pub fn set_character(&mut self, is_character: bool)
Set flag if is a character or not
Sourcepub fn remove_type(&mut self, mode: FileMode)
pub fn remove_type(&mut self, mode: FileMode)
Remove mode flag
Sourcepub fn permissions(&self) -> FilePermissions
pub fn permissions(&self) -> FilePermissions
Returns the permissions of the file this metadata is for.
Sourcepub fn accessed(&self) -> Result<SystemTime>
pub fn accessed(&self) -> Result<SystemTime>
Returns the last access time
Sourcepub fn modified(&self) -> Result<SystemTime>
pub fn modified(&self) -> Result<SystemTime>
Returns the last modification time
Trait Implementations§
Source§impl Clone for FileAttributes
impl Clone for FileAttributes
Source§fn clone(&self) -> FileAttributes
fn clone(&self) -> FileAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileAttributes
impl Debug for FileAttributes
Source§impl Default for FileAttributes
For packets which require dummy attributes
impl Default for FileAttributes
For packets which require dummy attributes
Source§impl<'de> Deserialize<'de> for FileAttributes
impl<'de> Deserialize<'de> for FileAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Metadata> for FileAttributes
For simple conversion of Metadata into FileAttributes
impl From<&Metadata> for FileAttributes
For simple conversion of Metadata into FileAttributes
Auto Trait Implementations§
impl Freeze for FileAttributes
impl RefUnwindSafe for FileAttributes
impl Send for FileAttributes
impl Sync for FileAttributes
impl Unpin for FileAttributes
impl UnwindSafe for FileAttributes
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
Mutably borrows from an owned value. Read more