pub struct NestedWorktreeBoundary { /* private fields */ }Expand description
A walk-scoped boundary that skips nested linked worktrees of this
repository: directories under the project root whose .git is a file
naming this repository’s common git dir worktrees/ entry (the layout
git worktree add creates). Indexing those checkouts again duplicates
every file, so every content-reading walker prunes them; an explicitly
named target inside one still walks, because the boundary only prunes
entries below the walk’s own root, never the root itself.
Not a worktree root: a nested independent repository (its own .git
directory, or a .git file naming another common dir), a submodule
(its gitdir lives under .git/modules/, not worktrees/), and the
boundary’s own root.
The check is cheap by construction: a directory is only examined past one
symlink_metadata when it holds a .git entry that is a file, the
repository’s common dir is resolved once per boundary, and each verdict is
cached per directory for the boundary’s life (one walk, or one watcher
filter call).
Implementations§
Source§impl NestedWorktreeBoundary
impl NestedWorktreeBoundary
Sourcepub fn for_root(root: &Path) -> Self
pub fn for_root(root: &Path) -> Self
One boundary per walk, rooted at the walk’s root. The root itself is never reported, so a project opened inside a worktree still walks.
Sourcepub fn is_nested_worktree_root(&self, dir: &Path) -> bool
pub fn is_nested_worktree_root(&self, dir: &Path) -> bool
True when dir itself is a nested linked worktree of this repository.
Only directories below the walk root are ever reported; callers check
entry.depth() > 0 (or an equivalent) so the named root of an
explicitly targeted walk is always admitted.
Sourcepub fn is_under_nested_worktree(&self, path: &Path) -> bool
pub fn is_under_nested_worktree(&self, path: &Path) -> bool
True when path is at or under a nested linked worktree of this
repository. The boundary root itself never counts, even when the
project is opened inside a worktree.
Auto Trait Implementations§
impl !Freeze for NestedWorktreeBoundary
impl Forget for NestedWorktreeBoundary
impl Move for NestedWorktreeBoundary
impl RefUnwindSafe for NestedWorktreeBoundary
impl Send for NestedWorktreeBoundary
impl Sync for NestedWorktreeBoundary
impl Unpin for NestedWorktreeBoundary
impl UnsafeUnpin for NestedWorktreeBoundary
impl UnwindSafe for NestedWorktreeBoundary
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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