Struct ignore::overrides::OverrideBuilder
source · pub struct OverrideBuilder { /* private fields */ }
Expand description
Builds a matcher for a set of glob overrides.
Implementations§
source§impl OverrideBuilder
impl OverrideBuilder
sourcepub fn new<P: AsRef<Path>>(path: P) -> OverrideBuilder
pub fn new<P: AsRef<Path>>(path: P) -> OverrideBuilder
Create a new override builder.
Matching is done relative to the directory path provided.
sourcepub fn build(&self) -> Result<Override, Error>
pub fn build(&self) -> Result<Override, Error>
Builds a new override matcher from the globs added so far.
Once a matcher is built, no new globs can be added to it.
sourcepub fn add(&mut self, glob: &str) -> Result<&mut OverrideBuilder, Error>
pub fn add(&mut self, glob: &str) -> Result<&mut OverrideBuilder, Error>
Add a glob to the set of overrides.
Globs provided here have precisely the same semantics as a single
line in a gitignore
file, where the meaning of !
is inverted:
namely, !
at the beginning of a glob will ignore a file. Without !
,
all matches of the glob provided are treated as whitelist matches.
sourcepub fn case_insensitive(
&mut self,
yes: bool
) -> Result<&mut OverrideBuilder, Error>
pub fn case_insensitive( &mut self, yes: bool ) -> Result<&mut OverrideBuilder, Error>
Toggle whether the globs should be matched case insensitively or not.
When this option is changed, only globs added after the change will be affected.
This is disabled by default.
Trait Implementations§
source§impl Clone for OverrideBuilder
impl Clone for OverrideBuilder
source§fn clone(&self) -> OverrideBuilder
fn clone(&self) -> OverrideBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for OverrideBuilder
impl Send for OverrideBuilder
impl Sync for OverrideBuilder
impl Unpin for OverrideBuilder
impl UnwindSafe for OverrideBuilder
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