pub struct Entry {
pub inode: Inode,
pub name: String,
pub kind: Kind,
pub size: Size,
}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, and size. 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
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn new(inode: Inode, name: String, type: Kind, size: Size) -> Self
pub fn new(inode: Inode, name: String, type: Kind, size: Size) -> 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)
§Examples
use file_system::{Entry, Inode, Kind, Size};
use alloc::string::String;
let entry = Entry::new(
123,
String::from("example.txt"),
Kind::File,
2048
);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 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