pub struct FileMetadata {
pub path: String,
pub is_dir: bool,
pub size: u64,
pub permissions: FilePermissions,
pub is_symlink: bool,
pub symlink_target: Option<String>,
pub modified: i64,
pub hash: Option<String>,
pub kind: FileKind,
}Expand description
File metadata
Fields§
§path: StringFile path
is_dir: boolWhether this is a directory
size: u64File size in bytes
permissions: FilePermissionsFile permissions
is_symlink: boolWhether path is a symlink
symlink_target: Option<String>Symlink target (if is_symlink)
modified: i64Last modified time (Unix timestamp)
hash: Option<String>File hash (for versioning)
kind: FileKindFile kind
Implementations§
Source§impl FileMetadata
impl FileMetadata
Sourcepub fn is_readable(&self) -> bool
pub fn is_readable(&self) -> bool
Check if file is readable
Sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Check if file is writable
Sourcepub fn is_executable(&self) -> bool
pub fn is_executable(&self) -> bool
Check if file is executable
Trait Implementations§
Source§impl Clone for FileMetadata
impl Clone for FileMetadata
Source§fn clone(&self) -> FileMetadata
fn clone(&self) -> FileMetadata
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileMetadata
impl RefUnwindSafe for FileMetadata
impl Send for FileMetadata
impl Sync for FileMetadata
impl Unpin for FileMetadata
impl UnwindSafe for FileMetadata
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)