[−][src]Struct sub_strs::Glob
Glob
This struct is used to find matches from a pattern string against some string.
The pattern string supports 2 special characters: *
and ?
:
*
: matches any characters or nothing at all.?
: matches one single character.
Notes
- The idea is inspired by https://en.wikipedia.org/wiki/Glob_%28programming%29, but this is not an implementation of that specification.
- Matches are case sensitive. If you want to ignore case, consider using
to_lowercase()
(orto_uppercase()
) on both pattern and target string.
Methods
impl<'a> Glob<'a>
[src]
pub fn new(src: &'a str) -> Self
[src]
pub fn matches<S>(&self, s: S) -> bool where
S: AsRef<str>,
[src]
S: AsRef<str>,
Trait Implementations
impl<'a> From<&'a str> for Glob<'a>
[src]
impl<'_> PartialEq<Glob<'_>> for Glob<'_>
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl<'a> Eq for Glob<'a>
[src]
impl<'a> Debug for Glob<'a>
[src]
impl<'_> Hash for Glob<'_>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,