AnonRegex

Trait AnonRegex 

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

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§