pub struct IgnoreList { /* private fields */ }Expand description
Parsed ignore-list (the merged .gitignore + .mkitignore patterns).
Implementations§
Source§impl IgnoreList
impl IgnoreList
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct an empty list (matches nothing user-defined; the
hard-coded .mkit / .git ignores still apply).
Sourcepub fn is_ignored(&self, rel_path: &str, is_dir: bool) -> bool
pub fn is_ignored(&self, rel_path: &str, is_dir: bool) -> bool
Returns true if rel_path (relative to the repo root, /-separated)
should be ignored. is_dir controls whether directory-only patterns
apply.
Callers walk top-down and skip ignored directories without descending,
which is what gives directory-only patterns (build/) their
“everything inside is ignored too” behavior — the contents are simply
never visited.
Sourcepub fn is_ignored_with_ancestors(&self, rel_path: &str, is_dir: bool) -> bool
pub fn is_ignored_with_ancestors(&self, rel_path: &str, is_dir: bool) -> bool
Like is_ignored, but also returns true when any
ancestor directory of rel_path is ignored — git treats
everything under an excluded directory as excluded.
Use this for one-shot path tests (an explicit add <path>, the restore
safety gate) where there is no top-down walk to carry the
ancestor-ignored bit. Walkers that descend top-down should instead
thread their own ancestor flag (cheaper) and skip ignored directories.
Trait Implementations§
Source§impl Clone for IgnoreList
impl Clone for IgnoreList
Source§fn clone(&self) -> IgnoreList
fn clone(&self) -> IgnoreList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IgnoreList
impl Debug for IgnoreList
Source§impl Default for IgnoreList
impl Default for IgnoreList
Source§fn default() -> IgnoreList
fn default() -> IgnoreList
Auto Trait Implementations§
impl Freeze for IgnoreList
impl RefUnwindSafe for IgnoreList
impl Send for IgnoreList
impl Sync for IgnoreList
impl Unpin for IgnoreList
impl UnsafeUnpin for IgnoreList
impl UnwindSafe for IgnoreList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more