Machine

Trait Machine 

Source
pub trait Machine<'t>: Sized {
    type CaptureIterator: Iterator<Item = Self>;
    type FindIterator: Iterator<Item = Match<'t>>;
    type SplitIterator: Iterator<Item = &'t str>;
    type SplitNIterator: Iterator<Item = &'t str>;

    const ORIGINAL_REGEX: &'static str;

    // Required methods
    fn captures(text: &'t str) -> Option<Self>;
    fn captures_iter(text: &'t str) -> Self::CaptureIterator;
    fn find(text: &'t str) -> Option<Match<'t>>;
    fn find_at(text: &'t str, start: usize) -> Option<Match<'t>>;
    fn find_iter(text: &'t str) -> Self::FindIterator;
    fn is_match(text: &'t str) -> bool;
    fn is_match_at(text: &'t str, start: usize) -> bool;
    fn replace(text: &'t str, rep: impl Replacer<'t, Self>) -> Cow<'t, str>;
    fn replace_all(text: &'t str, rep: impl Replacer<'t, Self>) -> Cow<'t, str>;
    fn replacen(
        text: &'t str,
        limit: usize,
        rep: impl Replacer<'t, Self>,
    ) -> Cow<'t, str>;
    fn split(text: &'t str) -> Self::SplitIterator;
    fn splitn(text: &'t str, limit: usize) -> Self::SplitNIterator;
}

Required Associated Constants§

Source

const ORIGINAL_REGEX: &'static str

Required Associated Types§

Required Methods§

Source

fn captures(text: &'t str) -> Option<Self>

Source

fn captures_iter(text: &'t str) -> Self::CaptureIterator

Source

fn find(text: &'t str) -> Option<Match<'t>>

Source

fn find_at(text: &'t str, start: usize) -> Option<Match<'t>>

Source

fn find_iter(text: &'t str) -> Self::FindIterator

Source

fn is_match(text: &'t str) -> bool

Source

fn is_match_at(text: &'t str, start: usize) -> bool

Source

fn replace(text: &'t str, rep: impl Replacer<'t, Self>) -> Cow<'t, str>

Source

fn replace_all(text: &'t str, rep: impl Replacer<'t, Self>) -> Cow<'t, str>

Source

fn replacen( text: &'t str, limit: usize, rep: impl Replacer<'t, Self>, ) -> Cow<'t, str>

Source

fn split(text: &'t str) -> Self::SplitIterator

Source

fn splitn(text: &'t str, limit: usize) -> Self::SplitNIterator

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§