use std::collections::VecDeque; use gix_hash::ObjectId; use gix_object::{bstr::BString, TreeRefIter}; /// The state required to visit [Changes] to be instantiated with `State::default()`. #[derive(Default, Clone)] pub struct State { buf1: Vec, buf2: Vec, trees: VecDeque, } type TreeInfoPair = (Option, Option); impl State { fn clear(&mut self) { self.trees.clear(); self.buf1.clear(); self.buf2.clear(); } } /// An iterator over changes of a tree, instantiated using `Changes::from(…)`. pub struct Changes<'a>(Option>); impl<'a, T> From for Changes<'a> where T: Into>>, { fn from(v: T) -> Self { Changes(v.into()) } } /// pub mod changes; /// pub mod visit; #[doc(inline)] pub use visit::Visit; /// A [Visit][visit::Visit] implementation to record every observed change and keep track of the changed paths. #[derive(Clone, Debug)] pub struct Recorder { path_deque: VecDeque, path: BString, location: Option, /// The observed changes. pub records: Vec, } /// Useful for use as delegate implementing [`Visit`] to keep track of all seen changes. Useful for debugging or printing primarily. pub mod recorder;