RegexPattern

Trait RegexPattern 

Source
pub trait RegexPattern: InnerRegexPattern {
    type Match;

    // Required method
    fn get_match(points: Range<usize>, pattern: PatternID) -> Self::Match;
}
Expand description

A regex pattern to search for

It can either be a single &str, or a list of &strs, in which case the matched pattern will be specified.

Required Associated Types§

Source

type Match

Eiter a Range<usize> or (usize, Range<usize>)

Required Methods§

Source

fn get_match(points: Range<usize>, pattern: PatternID) -> Self::Match

transforms a matched pattern into RegexPattern::Match

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.

Implementations on Foreign Types§

Source§

impl RegexPattern for &str

Source§

type Match = Range<usize>

Source§

fn get_match(points: Range<usize>, _pattern: PatternID) -> Self::Match

Source§

impl RegexPattern for &String

Source§

type Match = Range<usize>

Source§

fn get_match(points: Range<usize>, _pattern: PatternID) -> Self::Match

Source§

impl RegexPattern for &[&str]

Source§

type Match = (usize, Range<usize>)

Source§

fn get_match(points: Range<usize>, pattern: PatternID) -> Self::Match

Source§

impl RegexPattern for char

Source§

type Match = Range<usize>

Source§

fn get_match(points: Range<usize>, _pattern: PatternID) -> Self::Match

Source§

impl RegexPattern for String

Source§

type Match = Range<usize>

Source§

fn get_match(points: Range<usize>, _pattern: PatternID) -> Self::Match

Source§

impl<const N: usize> RegexPattern for [&str; N]

Source§

type Match = (usize, Range<usize>)

Source§

fn get_match(points: Range<usize>, pattern: PatternID) -> Self::Match

Implementors§