Trait git_repository::prelude::TreeIterExt
source · [−]pub trait TreeIterExt: Sealed {
fn changes_needed<FindFn, R, StateMut>(
&self,
other: TreeRefIter<'_>,
state: StateMut,
find: FindFn,
delegate: &mut R
) -> Result<(), Error>
where
FindFn: for<'b> FnMut(&oid, &'b mut Vec<u8>) -> Option<TreeRefIter<'b>>,
R: Visit,
StateMut: BorrowMut<State>;
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
Traverse both self
and the other
tree in lock-step to allow computing what’s needed to turn self
into other
,
with state
being provided to allow reusing allocations and find
being a function to lookup trees and turn them
into an iterator.
The delegate
implements a way to store the desired information about the traversal, allowing to pay only for what is needed.
It is also expected to store the result of the comparison, hence unit is returned.
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.