pub struct Metadata { /* private fields */ }
Implementations§
Source§impl Metadata
impl Metadata
pub fn new() -> Self
Sourcepub fn lookup(&self, parent: u64, name: &str) -> Result<u64, MetadataError>
pub fn lookup(&self, parent: u64, name: &str) -> Result<u64, MetadataError>
Finds the node with name name
in directory with inode number parent
.
Sourcepub fn get(&self, inode_num: u64) -> Option<&Node>
pub fn get(&self, inode_num: u64) -> Option<&Node>
Returns the node with inode number inode_num
.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, MetadataError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, MetadataError>
Deserializes the metadata.
Sourcepub fn add_child(&mut self, path: &[&str], inode_num: u64)
pub fn add_child(&mut self, path: &[&str], inode_num: u64)
Add a child at path
with inode number inode_num
.
Sourcepub fn insert_directory(
&mut self,
inode_num: u64,
mode: u16,
uid: u16,
gid: u16,
extended_attributes: ExtendedAttributes,
)
pub fn insert_directory( &mut self, inode_num: u64, mode: u16, uid: u16, gid: u16, extended_attributes: ExtendedAttributes, )
Inserts a directory node. This will not add a child to a directory; see add_child
.
Sourcepub fn insert_file(
&mut self,
inode_num: u64,
mode: u16,
uid: u16,
gid: u16,
extended_attributes: ExtendedAttributes,
)
pub fn insert_file( &mut self, inode_num: u64, mode: u16, uid: u16, gid: u16, extended_attributes: ExtendedAttributes, )
Inserts a file node. This will not add a child to a directory; see add_child
.
Sourcepub fn insert_symlink(
&mut self,
inode_num: u64,
target: String,
mode: u16,
uid: u16,
gid: u16,
extended_attributes: ExtendedAttributes,
)
pub fn insert_symlink( &mut self, inode_num: u64, target: String, mode: u16, uid: u16, gid: u16, extended_attributes: ExtendedAttributes, )
Inserts a symlink node. This will not add a child to a directory; see add_child
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
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
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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