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 Forget for GitIgnores
impl Freeze for GitIgnoreswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(PathBuf, Directory)>: Freeze,
PhantomData<Gitignore>: Freeze,
PhantomData<Vec<Gitignore>>: Freeze,
PhantomData<PathBuf>: Freeze,
PhantomData<RepositoryConfig>: Freeze,
impl Move for GitIgnores
impl RefUnwindSafe for GitIgnoreswhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>: RefUnwindSafe,
Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + Send + UnwindSafe + RefUnwindSafe>>: RefUnwindSafe,
Pool<Vec<usize>, fn() -> Vec<usize>>: RefUnwindSafe,
impl Send for GitIgnoreswhere
RawVecInner: Send,
RawTable<(PathBuf, Directory)>: Send,
RawTable<(Vec<u8>, Vec<usize>)>: Send,
Arc<dyn AcAutomaton>: Send,
RawTable<(Vec<u8>, Vec<(usize, Regex)>)>: Send,
Arc<RegexI>: Send,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Send,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Send,
Arc<Pool<Vec<usize>>>: Send,
impl Sync for GitIgnoreswhere
RawVecInner: Sync,
RawTable<(PathBuf, Directory)>: Sync,
RawTable<(Vec<u8>, Vec<usize>)>: Sync,
Arc<dyn AcAutomaton>: Sync,
RawTable<(Vec<u8>, Vec<(usize, Regex)>)>: Sync,
Arc<RegexI>: Sync,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Sync,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Sync,
Arc<Pool<Vec<usize>>>: Sync,
impl Unpin for GitIgnoreswhere
*const u8 is !null: Unpin,
Arc<[u32]>: Unpin,
Arc<dyn AcAutomaton>: Unpin,
Arc<RegexI>: Unpin,
Box<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Unpin,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Unpin,
Arc<Pool<Vec<usize>>>: Unpin,
impl UnsafeUnpin for GitIgnoreswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(PathBuf, Directory)>: UnsafeUnpin,
PhantomData<Gitignore>: UnsafeUnpin,
PhantomData<Vec<Gitignore>>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<RepositoryConfig>: UnsafeUnpin,
impl UnwindSafe for GitIgnoreswhere
RawVecInner: UnwindSafe,
HashMap<PathBuf, Directory, RandomState>: UnwindSafe,
HashMap<Vec<u8>, Vec<usize>, BuildHasherDefault<Hasher>>: UnwindSafe,
Arc<dyn AcAutomaton>: UnwindSafe,
HashMap<Vec<u8>, Vec<(usize, Regex)>, BuildHasherDefault<Hasher>>: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnwindSafe,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnwindSafe,
Arc<Pool<Vec<usize>>>: UnwindSafe,
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