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§
Sourcefn from_regex(s: &str) -> Option<Self>
fn from_regex(s: &str) -> Option<Self>
Try to construct an instance of this type from a string
Sourcefn match_locations(s: &str) -> SegmentMap<usize, Self>
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§
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.