Skip to main content

AnonRegex

Trait AnonRegex 

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

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::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::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§