pub struct GitIgnores { /* private fields */ }Expand description
The ignore rules of the Git work tree that contains a workspace.
Implementations§
Source§impl GitIgnores
impl GitIgnores
Sourcepub fn discover(workspace: &Path) -> Option<Self>
pub fn discover(workspace: &Path) -> Option<Self>
Read the rules for the work tree that contains workspace.
Returns None outside a work tree, or when Git ignores workspace itself.
Sourcepub fn is_ignored(&self, path: &Path, is_dir: bool) -> bool
pub fn is_ignored(&self, path: &Path, is_dir: bool) -> bool
Whether Git ignores path, an absolute path below the work tree.
Sourcepub fn depends_on(&self, path: &Path) -> bool
pub fn depends_on(&self, path: &Path) -> bool
Whether a change at path can change these rules: a .gitignore Git reads for the
workspace, an exclude file, or a repository configuration that now names another one.
Sourcepub fn sources_outside(&self) -> impl Iterator<Item = PathBuf> + '_
pub fn sources_outside(&self) -> impl Iterator<Item = PathBuf> + '_
The files the rules depend on outside the workspace directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitIgnores
impl RefUnwindSafe for GitIgnores
impl Send for GitIgnores
impl Sync for GitIgnores
impl Unpin for GitIgnores
impl UnsafeUnpin for GitIgnores
impl UnwindSafe for GitIgnores
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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