pub struct GlobSet { /* private fields */ }
Expand description
GlobSet represents a group of globs that can be matched together in a single pass.
Implementations§
source§impl GlobSet
impl GlobSet
sourcepub fn builder() -> GlobSetBuilder
pub fn builder() -> GlobSetBuilder
Create a new GlobSetBuilder
. A GlobSetBuilder
can be used to add
new patterns. Once all patterns have been added, build
should be
called to produce a GlobSet
, which can then be used for matching.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if this set is empty, and therefore matches nothing.
sourcepub fn is_match<P: AsRef<Path>>(&self, path: P) -> bool
pub fn is_match<P: AsRef<Path>>(&self, path: P) -> bool
Returns true if any glob in this set matches the path given.
sourcepub fn is_match_candidate(&self, path: &Candidate<'_>) -> bool
pub fn is_match_candidate(&self, path: &Candidate<'_>) -> bool
Returns true if any glob in this set matches the path given.
This takes a Candidate as input, which can be used to amortize the cost of preparing a path for matching.
sourcepub fn matches<P: AsRef<Path>>(&self, path: P) -> Vec<usize>
pub fn matches<P: AsRef<Path>>(&self, path: P) -> Vec<usize>
Returns the sequence number of every glob pattern that matches the given path.
sourcepub fn matches_candidate(&self, path: &Candidate<'_>) -> Vec<usize>
pub fn matches_candidate(&self, path: &Candidate<'_>) -> Vec<usize>
Returns the sequence number of every glob pattern that matches the given path.
This takes a Candidate as input, which can be used to amortize the cost of preparing a path for matching.
sourcepub fn matches_into<P: AsRef<Path>>(&self, path: P, into: &mut Vec<usize>)
pub fn matches_into<P: AsRef<Path>>(&self, path: P, into: &mut Vec<usize>)
Adds the sequence number of every glob pattern that matches the given path to the vec given.
into
is cleared before matching begins, and contains the set of
sequence numbers (in ascending order) after matching ends. If no globs
were matched, then into
will be empty.
sourcepub fn matches_candidate_into(
&self,
path: &Candidate<'_>,
into: &mut Vec<usize>,
)
pub fn matches_candidate_into( &self, path: &Candidate<'_>, into: &mut Vec<usize>, )
Adds the sequence number of every glob pattern that matches the given path to the vec given.
into
is cleared before matching begins, and contains the set of
sequence numbers (in ascending order) after matching ends. If no globs
were matched, then into
will be empty.
This takes a Candidate as input, which can be used to amortize the cost of preparing a path for matching.
Trait Implementations§
source§impl<'de> Deserialize<'de> for GlobSet
impl<'de> Deserialize<'de> for GlobSet
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Auto Trait Implementations§
impl Freeze for GlobSet
impl RefUnwindSafe for GlobSet
impl Send for GlobSet
impl Sync for GlobSet
impl Unpin for GlobSet
impl UnwindSafe for GlobSet
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)