Struct Override
pub struct Override(/* private field */);
Manages a set of overrides provided explicitly by the end user.
Implementations
impl Override
fn empty() -> OverrideReturns an empty matcher that never matches any file path.
fn path(&self) -> &PathReturns the directory of this override set.
All matches are done relative to this path.
fn is_empty(&self) -> boolReturns true if and only if this matcher is empty.
When a matcher is empty, it will never match any file path.
fn num_ignores(&self) -> u64Returns the total number of ignore globs.
fn num_whitelists(&self) -> u64Returns the total number of whitelisted globs.
fn matched<'a, P: AsRef<Path>>(&'a self, path: P, is_dir: bool) -> Match<Glob<'a>>Returns whether the given file path matched a pattern in this override matcher.
is_dirshould be true if the path refers to a directory and false otherwise.If there are no overrides, then this always returns
Match::None.If there is at least one whitelist override and
is_diris false, then this never returnsMatch::None, since non-matches are interpreted as ignored.The given path is matched to the globs relative to the path given when building the override matcher. Specifically, before matching
path, its prefix (as determined by a common suffix of the directory given) is stripped. If there is no common suffix/prefix overlap, thenpathis assumed to reside in the same directory as the root path for this set of overrides.
Trait Implementations
impl Clone for Override
fn clone(&self) -> Self
impl Debug for Override
fn fmt(&self, f: &mut Formatter<'_>) -> Result