Skip to main content

AnonRegex

Trait AnonRegex 

Source
pub trait AnonRegex<I, const N: usize>: Regex<I, N>
where I: HaystackItem,
{
Show 15 methods // 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 count_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> usize where H: HaystackOf<'a, I> { ... } fn range_of_match<'a, H>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Range<usize>> where H: HaystackOf<'a, I> { ... } fn range_of_all_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> RangeOfAllMatches<'a, I, H, Self::Pattern> where H: HaystackOf<'a, I> { ... } fn slice_match<'a, H>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<<H as HaystackIter<'a>>::Slice> where H: HaystackOf<'a, I> { ... } fn slice_all_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> SliceAllMatches<'a, I, H, Self::Pattern> where H: HaystackOf<'a, I> { ... } fn do_capture<'a, H>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>> where H: HaystackOf<'a, I> { ... } fn find_capture<'a, H>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, <H as HaystackIter<'a>>::Slice>> where H: HaystackOf<'a, I> { ... } fn find_all_captures<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> FindAllCaptures<'a, Self, I, H, N> where H: HaystackOf<'a, I> { ... } fn replace<'a, M>( &self, hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice, ) -> bool where M: OwnedHaystackable<I> { ... } fn replace_all<'a, M>( &self, hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice, ) -> usize where M: OwnedHaystackable<I> { ... } fn replace_all_using<M>( &self, hay_mut: &mut M, using: impl FnMut() -> M, ) -> usize where M: OwnedHaystackable<I> { ... } fn replace_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> bool where M: OwnedHaystackable<I>, F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M { ... } fn replace_all_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> usize where M: OwnedHaystackable<I>, F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M { ... }
}
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 expression 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 count_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> usize
where H: HaystackOf<'a, I>,

Source

fn range_of_match<'a, H>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Range<usize>>
where H: HaystackOf<'a, I>,

Source

fn range_of_all_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> RangeOfAllMatches<'a, I, H, Self::Pattern>
where H: HaystackOf<'a, I>,

Source

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

Source

fn slice_all_matches<'a, H>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> SliceAllMatches<'a, I, H, Self::Pattern>
where H: HaystackOf<'a, I>,

Source

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

Source

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

Source

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

Source

fn replace<'a, M>( &self, hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice, ) -> bool
where M: OwnedHaystackable<I>,

Source

fn replace_all<'a, M>( &self, hay_mut: &mut M, with: <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice, ) -> usize
where M: OwnedHaystackable<I>,

Source

fn replace_all_using<M>( &self, hay_mut: &mut M, using: impl FnMut() -> M, ) -> usize
where M: OwnedHaystackable<I>,

Source

fn replace_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> bool
where M: OwnedHaystackable<I>, F: for<'a> FnOnce(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,

Source

fn replace_all_captured<M, F>(&self, hay_mut: &mut M, replacer: F) -> usize
where M: OwnedHaystackable<I>, F: for<'a> FnMut(Self::Capture<'a, <<M as OwnedHaystackable<I>>::Hay<'a> as HaystackIter<'a>>::Slice>) -> M,

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§