pub struct FileTree {
pub root: DirectoryNode,
}Fields§
§root: DirectoryNodeImplementations§
Source§impl FileTree
impl FileTree
pub fn new() -> Self
pub fn insert( &mut self, path: &[u8], node: TreeNode, ) -> Result<(), FileTreeError>
pub fn get(&self, path: &[u8]) -> Option<&TreeNode>
pub fn get_mut(&mut self, path: &[u8]) -> Option<&mut TreeNode>
pub fn remove(&mut self, path: &[u8]) -> Option<TreeNode>
pub fn node_count(&self) -> u64
pub fn total_data_size(&self) -> u64
pub fn merge_layer(&mut self, layer: FileTree)
Sourcepub fn strip_file_data(&mut self)
pub fn strip_file_data(&mut self)
Strip file data from this tree, keeping only directory structure and metadata.
After calling this, all RegularFile nodes have empty FileData::Memory(Vec::new()).
Used to reduce memory after writing a per-layer EROFS while retaining the tree
for fsmeta merge.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileTree
impl RefUnwindSafe for FileTree
impl Send for FileTree
impl Sync for FileTree
impl Unpin for FileTree
impl UnsafeUnpin for FileTree
impl UnwindSafe for FileTree
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