pub struct Platform<'a, 'repo> { /* private fields */ }
Expand description
The diffing platform returned by Tree::changes()
.
Implementations§
source§impl<'a, 'old> Platform<'a, 'old>
impl<'a, 'old> Platform<'a, 'old>
Add the item to compare to.
sourcepub fn for_each_to_obtain_tree<'new, E>(
&mut self,
other: &Tree<'new>,
for_each: impl FnMut(Change<'_, 'old, 'new>) -> Result<Action, E>
) -> Result<(), Error>where
E: Error + Sync + Send + 'static,
pub fn for_each_to_obtain_tree<'new, E>(
&mut self,
other: &Tree<'new>,
for_each: impl FnMut(Change<'_, 'old, 'new>) -> Result<Action, E>
) -> Result<(), Error>where
E: Error + Sync + Send + 'static,
Call for_each
repeatedly with all changes that are needed to convert the source of the diff to the tree to other
.
other
could also be created with the empty_tree()
method to handle the first commit
in a repository - it doesn’t have a parent, equivalent to compare ‘nothing’ to something.
source§impl<'a, 'repo> Platform<'a, 'repo>
impl<'a, 'repo> Platform<'a, 'repo>
Configuration
sourcepub fn track_filename(&mut self) -> &mut Self
pub fn track_filename(&mut self) -> &mut Self
Keep track of file-names, which makes the location
field usable with the filename of the changed item.
sourcepub fn track_path(&mut self) -> &mut Self
pub fn track_path(&mut self) -> &mut Self
Keep track of the entire path of a change, relative to the repository.
This makes the location
field usable.