pub struct Entry {
pub inode: Inode,
pub name: String,
pub kind: Kind,
pub size: Size,
pub modification: Time,
}Expand description
Represents a single entry within a directory.
A directory entry contains metadata about a file system object including its inode number, name, type, size, and last modification time. This structure is used when reading directory contents to provide information about each item within the directory.
Fields§
§inode: InodeThe inode number identifying this file system object
name: StringThe name of this directory entry
kind: KindThe type of file system object (file, directory, etc.)
size: SizeThe size of the file system object in bytes
modification: TimeThe last modification time, in UTC seconds since the Unix epoch.
0 means unknown: the time was never set (no UTC clock was available)
or the object was created without Xila attributes.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn new(
inode: Inode,
name: String,
type: Kind,
size: Size,
modification: Time,
) -> Self
pub fn new( inode: Inode, name: String, type: Kind, size: Size, modification: Time, ) -> Self
Create a new directory entry with the specified metadata.
§Arguments
inode- Unique inode number for this file system objectname- Name of the file or directorytype- Type of the file system objectsize- Size in bytes (for files) or entry count (for directories)modification- Last modification time of the file system object
§Examples
use file_system::{Entry, Inode, Kind, Size, Time};
use alloc::string::String;
let entry = Entry::new(
123,
String::from("example.txt"),
Kind::File,
2048,
Time::new(1_700_000_000),
);pub fn join_path(&self, base_path: impl AsRef<Path>) -> Option<PathOwned>
Trait Implementations§
impl Eq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
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