pub struct GitIgnoreFile { /* private fields */ }Expand description
Models the effective contents of multiple .gitignore files.
Implementations§
Source§impl GitIgnoreFile
impl GitIgnoreFile
pub fn empty() -> Arc<Self>
Sourcepub fn chain(
self: &Arc<Self>,
prefix: &RepoPath,
ignore_path: &Path,
input: &[u8],
) -> Result<Arc<Self>, GitIgnoreError>
pub fn chain( self: &Arc<Self>, prefix: &RepoPath, ignore_path: &Path, input: &[u8], ) -> Result<Arc<Self>, GitIgnoreError>
Concatenates new .gitignore content at the prefix directory.
Sourcepub fn chain_with_file(
self: &Arc<Self>,
prefix: &RepoPath,
file: PathBuf,
) -> Result<Arc<Self>, GitIgnoreError>
pub fn chain_with_file( self: &Arc<Self>, prefix: &RepoPath, file: PathBuf, ) -> Result<Arc<Self>, GitIgnoreError>
Concatenates new .gitignore file at the prefix directory.
Sourcepub fn matches_file(&self, path: &RepoPath) -> bool
pub fn matches_file(&self, path: &RepoPath) -> bool
Returns whether the specified file path should be ignored.
This method does not directly define which files should not be tracked in the repository. Instead, it performs a simple matching against the last applicable .gitignore line.
This only performs exact matching; callers handle recursion of parent directories. Callers shouldn’t recursively match inside ignored directories, because all (untracked) child files should also be ignored; the exact matching logic won’t give correct results in that case.
Sourcepub fn matches_dir(&self, path: &RepoPath) -> bool
pub fn matches_dir(&self, path: &RepoPath) -> bool
Returns whether the specified directory path should be ignored.
See GitIgnoreFile::matches_file() for details.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitIgnoreFile
impl RefUnwindSafe for GitIgnoreFile
impl Send for GitIgnoreFile
impl Sync for GitIgnoreFile
impl Unpin for GitIgnoreFile
impl UnsafeUnpin for GitIgnoreFile
impl UnwindSafe for GitIgnoreFile
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> 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