Struct relay_common::glob2::Glob
source · pub struct Glob { /* private fields */ }
Expand description
A simple glob matcher.
Supported are ?
for a single char, *
for all but a slash and
**
to match with slashes.
Implementations§
source§impl Glob
impl Glob
sourcepub fn builder(glob: &str) -> GlobBuilder<'_>
pub fn builder(glob: &str) -> GlobBuilder<'_>
Creates the GlobBuilder
, which can be fine-tunned using helper methods.
sourcepub fn new(glob: &str) -> Glob
pub fn new(glob: &str) -> Glob
Creates a new glob from a string.
All the glob patterns (wildcards) are enabled in the captures, and can be returned by
matches
function.
sourcepub fn replace_captures(&self, input: &str, replacement: &str) -> String
pub fn replace_captures(&self, input: &str, replacement: &str) -> String
Currently support replacing only all *
in the input string with provided replacement.
If no match is found, then a copy of the string is returned unchanged.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Glob
impl<'de> Deserialize<'de> for Glob
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)