pub enum NamePattern {
Exact(String),
Glob(Pattern),
Regex(Regex),
}Expand description
A name pattern for matching function names.
Variants§
Exact(String)
Exact string match.
Glob(Pattern)
Glob pattern (using glob crate syntax).
Regex(Regex)
Regular expression pattern.
Implementations§
Source§impl NamePattern
impl NamePattern
Sourcepub fn parse(name: &str) -> Result<Self, PatternError>
pub fn parse(name: &str) -> Result<Self, PatternError>
Parse a name string into a pattern.
glob:pattern→ Glob patternregex:pattern→ Regex pattern- anything else → Exact match
§Errors
Returns an error if glob or regex pattern is invalid.
Trait Implementations§
Source§impl Clone for NamePattern
impl Clone for NamePattern
Source§fn clone(&self) -> NamePattern
fn clone(&self) -> NamePattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NamePattern
impl Debug for NamePattern
Source§impl Display for NamePattern
impl Display for NamePattern
Source§impl PartialEq for NamePattern
impl PartialEq for NamePattern
Auto Trait Implementations§
impl Freeze for NamePattern
impl RefUnwindSafe for NamePattern
impl Send for NamePattern
impl Sync for NamePattern
impl Unpin for NamePattern
impl UnsafeUnpin for NamePattern
impl UnwindSafe for NamePattern
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