pub struct Cursor<'a, 'find> { /* private fields */ }
Expand description
A way to constrain all tree-edits to a given subtree.
Implementations§
Source§impl Cursor<'_, '_>
impl Cursor<'_, '_>
Sourcepub fn get<I, C>(&self, rela_path: I) -> Option<&Entry>
pub fn get<I, C>(&self, rela_path: I) -> Option<&Entry>
Obtain the entry at rela_path
or return None
if none was found, or the tree wasn’t yet written
to that point.
Note that after writing only the root path remains, all other intermediate trees are removed.
The entry can be anything that can be stored in a tree, but may have a null-id if it’s a newly
inserted tree. Also, ids of trees might not be accurate as they may have been changed in memory.
Sourcepub fn upsert<I, C>(
&mut self,
rela_path: I,
kind: EntryKind,
id: ObjectId,
) -> Result<&mut Self, Error>
pub fn upsert<I, C>( &mut self, rela_path: I, kind: EntryKind, id: ObjectId, ) -> Result<&mut Self, Error>
Like Editor::upsert()
, but with the constraint of only editing in this cursor’s tree.
Sourcepub fn remove<I, C>(&mut self, rela_path: I) -> Result<&mut Self, Error>
pub fn remove<I, C>(&mut self, rela_path: I) -> Result<&mut Self, Error>
Like Editor::remove()
, but with the constraint of only editing in this cursor’s tree.
Auto Trait Implementations§
impl<'a, 'find> Freeze for Cursor<'a, 'find>
impl<'a, 'find> !RefUnwindSafe for Cursor<'a, 'find>
impl<'a, 'find> !Send for Cursor<'a, 'find>
impl<'a, 'find> !Sync for Cursor<'a, 'find>
impl<'a, 'find> Unpin for Cursor<'a, 'find>
impl<'a, 'find> !UnwindSafe for Cursor<'a, 'find>
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