Trait FromRegex

Source
pub trait FromRegex: Sized {
    // Required methods
    fn from_regex(s: &str) -> Option<Self>;
    fn match_locations(s: &str) -> SegmentMap<usize, Self>;

    // Provided method
    fn matches(s: &str) -> Vec<Self> { ... }
}
Expand description

Try to construct an instance of this type from a string

Required Methods§

Source

fn from_regex(s: &str) -> Option<Self>

Try to construct an instance of this type from a string

Source

fn match_locations(s: &str) -> SegmentMap<usize, Self>

Search through a string and return all instances of this type matched, As well as the ranges at which they occur.

Provided Methods§

Source

fn matches(s: &str) -> Vec<Self>

Search through a string and return all instances of this type matched

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§