pub struct Tree(/* private fields */);Implementations§
Source§impl Tree
impl Tree
Sourcepub fn insert_directory<'a>(&self, path: &'a str) -> Result<'a, ()>
pub fn insert_directory<'a>(&self, path: &'a str) -> Result<'a, ()>
Create a new directory at path, creating all entries in between
Sourcepub fn insert_file<'a>(&self, path: &'a str, file: Entry) -> Result<'a, ()>
pub fn insert_file<'a>(&self, path: &'a str, file: Entry) -> Result<'a, ()>
Insert or overwrite an file at path, creating all entries in between
Sourcepub fn update_file<'a>(&self, path: &'a str, file: Entry) -> Result<'a, ()>
pub fn update_file<'a>(&self, path: &'a str, file: Entry) -> Result<'a, ()>
Updates an file at path
Sourcepub fn remove<'a>(&self, path: &'a str) -> Result<'a, ()>
pub fn remove<'a>(&self, path: &'a str) -> Result<'a, ()>
Recursively remove a subtree the path
pub fn node_by_ref(&self, noderef: &Digest) -> Option<Arc<Node>>
Sourcepub fn node_by_path<'a>(&self, path: &'a str) -> Result<'a, Option<Arc<Node>>>
pub fn node_by_path<'a>(&self, path: &'a str) -> Result<'a, Option<Arc<Node>>>
Return a file system node
Sourcepub fn move_node<'a>(
&self,
old_path: &'a str,
new_path: &'a str,
) -> Result<'a, ()>
pub fn move_node<'a>( &self, old_path: &'a str, new_path: &'a str, ) -> Result<'a, ()>
Move the file from the old path to the new path in the tree
pub fn retain<F>(&self, f: F)
pub fn iter_files(&self) -> TreeIterator<'_> ⓘ
pub fn clear(&self) -> usize
Trait Implementations§
Source§impl Collection for Tree
impl Collection for Tree
Source§type Depth = Incremental
type Depth = Incremental
Use this strategy to load the collection. Read more
Source§type Key = <VersionedMap<[u8; 32], Node> as Collection>::Key
type Key = <VersionedMap<[u8; 32], Node> as Collection>::Key
The key that the predicate will use to decide whether to pull
more data into memory.
Source§type Serialized = <VersionedMap<[u8; 32], Node> as Collection>::Serialized
type Serialized = <VersionedMap<[u8; 32], Node> as Collection>::Serialized
The serialized record format. This type will typically
implement
serde::SerializeSource§type Item = <VersionedMap<[u8; 32], Node> as Collection>::Item
type Item = <VersionedMap<[u8; 32], Node> as Collection>::Item
This is equivalent to
Iterator::Item, and should contain a
full record that can be inserted into the in-memory store.Source§fn key(from: &Self::Serialized) -> &Self::Key
fn key(from: &Self::Serialized) -> &Self::Key
Get the key based on the deserialized data. You want this to
be a reference that’s easy to derive from the serialized data.
Auto Trait Implementations§
impl !Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Query for Twhere
T: Collection,
impl<T> Query for Twhere
T: Collection,
Source§type Key = <T as Collection>::Key
type Key = <T as Collection>::Key
The key that the predicate will use to decide whether to pull
more data into memory.