pub struct InputEntry {
pub name: Arc<String>,
pub kind: InputEntryKind,
pub metadata: InputMetadata,
}Available on crate features
sync and write only.Expand description
A named entry in the input tree, representing a file, directory, symlink, or device.
This struct is the building block of InputTree. Each entry has a name,
a kind (file, directory, symlink, or device), and optional POSIX metadata.
Fields§
§name: Arc<String>The name of the entry (e.g., "README.txt" or "src").
kind: InputEntryKindThe kind of entry (file, directory, symlink, or device).
metadata: InputMetadataOptional POSIX metadata (permissions, ownership, timestamps).
Implementations§
Source§impl InputEntry
impl InputEntry
Sourcepub fn file(name: impl Into<String>, contents: impl Into<Vec<u8>>) -> Self
pub fn file(name: impl Into<String>, contents: impl Into<Vec<u8>>) -> Self
Creates a regular file entry with content.
Sourcepub fn directory(name: impl Into<String>, children: Vec<Self>) -> Self
pub fn directory(name: impl Into<String>, children: Vec<Self>) -> Self
Creates a directory entry with children.
Sourcepub fn symlink(name: impl Into<String>, target: impl Into<String>) -> Self
pub fn symlink(name: impl Into<String>, target: impl Into<String>) -> Self
Creates a symbolic link entry.
Sourcepub fn character_device(name: impl Into<String>, major: u32, minor: u32) -> Self
pub fn character_device(name: impl Into<String>, major: u32, minor: u32) -> Self
Creates a character device entry (Unix only).
Sourcepub fn block_device(name: impl Into<String>, major: u32, minor: u32) -> Self
pub fn block_device(name: impl Into<String>, major: u32, minor: u32) -> Self
Creates a block device entry (Unix only).
Sourcepub fn with_metadata(self, metadata: InputMetadata) -> Self
pub fn with_metadata(self, metadata: InputMetadata) -> Self
Sets the metadata for this entry.
Trait Implementations§
Source§impl Clone for InputEntry
impl Clone for InputEntry
Source§impl Debug for InputEntry
impl Debug for InputEntry
impl Eq for InputEntry
Source§impl PartialEq for InputEntry
impl PartialEq for InputEntry
impl StructuralPartialEq for InputEntry
Auto Trait Implementations§
impl !RefUnwindSafe for InputEntry
impl !UnwindSafe for InputEntry
impl Freeze for InputEntry
impl Send for InputEntry
impl Sync for InputEntry
impl Unpin for InputEntry
impl UnsafeUnpin for InputEntry
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