AnonRegex

Trait AnonRegex 

Source
pub trait AnonRegex<I: HaystackItem, const N: usize>: Regex<I, N> {
    // Provided methods
    fn is_match<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
    ) -> bool { ... }
    fn contains_match<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
    ) -> bool { ... }
    fn slice_matching<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
    ) -> Option<H::Slice> { ... }
    fn slice_all_matching<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
        overlapping: bool,
    ) -> Vec<H::Slice> { ... }
    fn do_capture<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
    ) -> Option<Self::Capture<'a, H>> { ... }
    fn find_capture<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
    ) -> Option<Self::Capture<'a, H>> { ... }
    fn find_all_captures<'a, H: HaystackOf<'a, I>>(
        &self,
        hay: impl IntoHaystack<'a, H>,
        overlapping: bool,
    ) -> Vec<Self::Capture<'a, H>> { ... }
}
Expand description

A trait that is automatically implemented for ‘anonymous’ regular expression types. There is only one difference between this and Regex: all functions take self as the first parameter, removing the need to name the type itself.

An AnonRegex can be created by invoking regex!() without a type identifier or visibility. The result is an instance of an unnamable type implementing AnonRegex.

Provided Methods§

Source

fn is_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> bool

Source

fn contains_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> bool

Source

fn slice_matching<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<H::Slice>

Source

fn slice_all_matching<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> Vec<H::Slice>

Source

fn do_capture<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, H>>

Source

fn find_capture<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, H>>

Source

fn find_all_captures<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> Vec<Self::Capture<'a, H>>

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§