Trait gix::prelude::TreeIterExt
source · pub trait TreeIterExt: Sealed {
// Required method
fn traverse<StateMut, Find, V>(
&self,
state: StateMut,
find: Find,
delegate: &mut V
) -> Result<(), Error>
where Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Option<TreeRefIter<'a>>,
StateMut: BorrowMut<State>,
V: Visit;
}
Expand description
An extension trait for tree iterators
Required Methods§
sourcefn traverse<StateMut, Find, V>(
&self,
state: StateMut,
find: Find,
delegate: &mut V
) -> Result<(), Error>where
Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Option<TreeRefIter<'a>>,
StateMut: BorrowMut<State>,
V: Visit,
fn traverse<StateMut, Find, V>( &self, state: StateMut, find: Find, delegate: &mut V ) -> Result<(), Error>where Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Option<TreeRefIter<'a>>, StateMut: BorrowMut<State>, V: Visit,
Traverse this tree with state
being provided to potentially reuse allocations, and find
being a function to lookup trees
and turn them into iterators.
The delegate
implements a way to store details about the traversal to allow paying only for what’s actually used.
Since it is expected to store the operation result, unit is returned.