pub struct Glob { /* private fields */ }
Expand description
Unix style globs for matching paths in the resolver. All common unix globing features are supported.
- ? matches any character except the path separator
- * matches zero or more characters, but not the path separator
- ** recursively matches containers. It’s only legal uses are //foo, /foo//bar, and /foo/bar/**, which match respectively, any path ending in foo, any path starting with /foo and ending in bar, and any path starting with /foo/bar.
- {a, b}, matches a or b where a and b are glob patterns, {} can’t be nested however.
- [ab], [!ab], matches respectively the char a or b, and any char but a or b.
- any of the above metacharacters can be escaped with a , a literal \ may be produced with \.
e.g.
/solar/{stats,settings}/*
-> all leaf paths under /solar/stats or /solar/settings.
/s*/s*/**
-> any path who’s first two levels start with s.
/**/?
-> any path who’s final component is a single character
/marketdata/{IBM,MSFT,AMZN}/last
Implementations§
Source§impl Glob
impl Glob
Sourcepub fn is_glob(s: &str) -> bool
pub fn is_glob(s: &str) -> bool
returns true if the specified string contains any non escaped glob meta chars.
Sourcepub fn first_glob_char(s: &str) -> Option<usize>
pub fn first_glob_char(s: &str) -> Option<usize>
returns the index of the first glob special char or None if raw is a plain string
pub fn new(raw: ArcStr) -> Result<Glob>
pub fn base(&self) -> &str
pub fn scope(&self) -> &Scope
pub fn glob(&self) -> &Glob
pub fn into_glob(self) -> Glob
pub fn raw(&self) -> &ArcStr
Trait Implementations§
Source§impl Pack for Glob
impl Pack for Glob
fn encoded_len(&self) -> usize
fn encode(&self, buf: &mut impl BufMut) -> Result<(), PackError>
fn decode(buf: &mut impl Buf) -> Result<Self, PackError>
fn const_encoded_len() -> Option<usize>
fn decode_into(&mut self, buf: &mut impl Buf) -> Result<(), PackError>where
Self: Sized,
impl Eq for Glob
impl StructuralPartialEq for Glob
Auto Trait Implementations§
impl Freeze for Glob
impl RefUnwindSafe for Glob
impl Send for Glob
impl Sync for Glob
impl Unpin for Glob
impl UnwindSafe for Glob
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.