Glob

Struct Glob 

Source
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

Source

pub fn plain(&self) -> &str

return the longest plain string before the first glob char

Source

pub fn is_glob(s: &str) -> bool

returns true if the specified string contains any non escaped glob meta chars.

Source

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

Source

pub fn new(raw: ArcStr) -> Result<Glob>

Source

pub fn base(&self) -> &str

Source

pub fn scope(&self) -> &Scope

Source

pub fn glob(&self) -> &Glob

Source

pub fn into_glob(self) -> Glob

Source

pub fn raw(&self) -> &ArcStr

Trait Implementations§

Source§

impl Clone for Glob

Source§

fn clone(&self) -> Glob

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Glob

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FromValue for Glob

Source§

fn from_value(v: Value) -> Result<Self>

attempt to cast v to the type of self using any reasonable means
Source§

fn get(v: Value) -> Option<Self>
where Self: Sized,

extract the type of self from v if the type of v is equivelent to the type of self, otherwise return None.
Source§

impl Into<Value> for Glob

Source§

fn into(self) -> Value

Converts this type into the (usually inferred) input type.
Source§

impl Pack for Glob

Source§

fn encoded_len(&self) -> usize

Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), PackError>

Source§

fn decode(buf: &mut impl Buf) -> Result<Self, PackError>

Source§

fn const_encoded_len() -> Option<usize>

Source§

fn decode_into(&mut self, buf: &mut impl Buf) -> Result<(), PackError>
where Self: Sized,

Source§

impl PartialEq for Glob

Source§

fn eq(&self, other: &Glob) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Glob

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.