use std::collections::VecDeque;
use git_object::bstr::{BStr, BString};
pub trait Visit {
fn pop_front_tracked_path_and_set_current(&mut self);
fn push_back_tracked_path_component(&mut self, component: &BStr);
fn push_path_component(&mut self, component: &BStr);
fn pop_path_component(&mut self);
fn visit_tree(&mut self, entry: &git_object::tree::EntryRef<'_>) -> visit::Action;
fn visit_nontree(&mut self, entry: &git_object::tree::EntryRef<'_>) -> visit::Action;
}
#[derive(Clone, Debug, Default)]
pub struct Recorder {
path_deque: VecDeque<BString>,
path: BString,
pub records: Vec<recorder::Entry>,
}
pub mod visit {
#[derive(Clone, Copy, PartialOrd, PartialEq, Ord, Eq, Hash)]
pub enum Action {
Continue,
Cancel,
Skip,
}
impl Action {
pub fn cancelled(&self) -> bool {
matches!(self, Action::Cancel)
}
}
}
pub mod recorder;
pub mod breadthfirst;
pub use breadthfirst::impl_::traverse as breadthfirst;