Struct GlobSet
struct GlobSet { ... }
GlobSet represents a group of globs that can be matched together in a single pass.
Implementations
impl GlobSet
fn builder() -> GlobSetBuilderCreate a new
GlobSetBuilder. AGlobSetBuildercan be used to add new patterns. Once all patterns have been added,buildshould be called to produce aGlobSet, which can then be used for matching.const fn empty() -> GlobSetCreate an empty
GlobSet. An empty set matches nothing.fn is_empty(self: &Self) -> boolReturns true if this set is empty, and therefore matches nothing.
fn len(self: &Self) -> usizeReturns the number of globs in this set.
fn is_match<P: AsRef<Path>>(self: &Self, path: P) -> boolReturns true if any glob in this set matches the path given.
fn is_match_candidate(self: &Self, path: &Candidate<'_>) -> boolReturns 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.
fn matches_all<P: AsRef<Path>>(self: &Self, path: P) -> boolReturns true if all globs in this set match the path given.
This will return true if the set of globs is empty, as in that case all
0of the globs will match.use ; let mut builder = new; builder.add; builder.add; let set = builder.build.unwrap; assert!; assert!; assert!;fn matches_all_candidate(self: &Self, path: &Candidate<'_>) -> boolReturns ture if all globs in this set match the path given.
This takes a Candidate as input, which can be used to amortize the cost of peparing a path for matching.
This will return true if the set of globs is empty, as in that case all
0of the globs will match.fn matches<P: AsRef<Path>>(self: &Self, path: P) -> Vec<usize>Returns the sequence number of every glob pattern that matches the given path.
fn matches_candidate(self: &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.
fn matches_into<P: AsRef<Path>>(self: &Self, path: P, into: &mut Vec<usize>)Adds the sequence number of every glob pattern that matches the given path to the vec given.
intois cleared before matching begins, and contains the set of sequence numbers (in ascending order) after matching ends. If no globs were matched, thenintowill be empty.fn matches_candidate_into(self: &Self, path: &Candidate<'_>, into: &mut Vec<usize>)Adds the sequence number of every glob pattern that matches the given path to the vec given.
intois cleared before matching begins, and contains the set of sequence numbers (in ascending order) after matching ends. If no globs were matched, thenintowill be empty.This takes a Candidate as input, which can be used to amortize the cost of preparing a path for matching.
fn new<I, G>(globs: I) -> Result<GlobSet, Error> where I: IntoIterator<Item = G>, G: AsRef<Glob>Builds a new matcher from a collection of Glob patterns.
Once a matcher is built, no new patterns can be added to it.
impl Clone for GlobSet
fn clone(self: &Self) -> GlobSet
impl Debug for GlobSet
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for GlobSet
fn default() -> SelfCreate a default empty GlobSet.
impl Freeze for GlobSet
impl RefUnwindSafe for GlobSet
impl Send for GlobSet
impl Sync for GlobSet
impl Unpin for GlobSet
impl UnsafeUnpin for GlobSet
impl UnwindSafe for GlobSet
impl<T> Any for GlobSet
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for GlobSet
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for GlobSet
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for GlobSet
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for GlobSet
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for GlobSet
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for GlobSet
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for GlobSet
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for GlobSet
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>