gix_diff/tree_with_rewrites/mod.rs
1use crate::{Rewrites, tree::recorder::Location};
2
3mod change;
4pub use change::{Change, ChangeRef};
5
6/// Returned by the [`tree_with_rewrites()`](super::tree_with_rewrites()) function to control flow.
7///
8/// Use [`std::ops::ControlFlow::Continue`] to continue the traversal of changes.
9/// Use [`std::ops::ControlFlow::Break`] to stop the traversal of changes and stop calling the function that returned it.
10pub type Action = std::ops::ControlFlow<()>;
11
12/// Options for use in [`tree_with_rewrites()`](super::tree_with_rewrites()).
13#[derive(Default, Clone, Debug)]
14pub struct Options {
15 /// Determine how locations of changes, i.e. their repository-relative path, should be tracked.
16 /// If `None`, locations will always be empty.
17 pub location: Option<Location>,
18 /// If not `None`, rename tracking will be performed accordingly.
19 pub rewrites: Option<Rewrites>,
20}
21
22pub(super) mod function;