Struct Override

struct Override(_)

Manages a set of overrides provided explicitly by the end user.

Implementations

impl Override

fn empty() -> Override

Returns an empty matcher that never matches any file path.

fn path(self: &Self) -> &Path

Returns the directory of this override set.

All matches are done relative to this path.

fn is_empty(self: &Self) -> bool

Returns 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: &Self) -> u64

Returns the total number of ignore globs.

fn num_whitelists(self: &Self) -> u64

Returns the total number of whitelisted globs.

fn matched<'a, P: AsRef<Path>>(self: &'a Self, path: P, is_dir: bool) -> Match<Glob<'a>>

Returns whether the given file path matched a pattern in this override matcher.

is_dir should 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_dir is false, then this never returns Match::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, then path is assumed to reside in the same directory as the root path for this set of overrides.

impl Clone for Override

fn clone(self: &Self) -> Override

impl Debug for Override

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Freeze for Override

impl RefUnwindSafe for Override

impl Send for Override

impl Sync for Override

impl Unpin for Override

impl UnwindSafe for Override

impl<T> Any for Override

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Override

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Override

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Override

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Override

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for Override

unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> ToOwned for Override

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Override

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Override

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Override

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>