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§
Sourcefn is_match<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> bool
fn is_match<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> bool
See Regex::is_match.
Sourcefn contains_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
Sourcefn slice_matching<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<H::Slice>
fn slice_matching<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<H::Slice>
Sourcefn slice_all_matching<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> Vec<H::Slice>
fn slice_all_matching<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, overlapping: bool, ) -> Vec<H::Slice>
Sourcefn do_capture<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
) -> Option<Self::Capture<'a, H>>
fn do_capture<'a, H: HaystackOf<'a, I>>( &self, hay: impl IntoHaystack<'a, H>, ) -> Option<Self::Capture<'a, H>>
See Regex::do_capture.
Sourcefn find_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>>
See Regex::find_capture.
Sourcefn find_all_captures<'a, H: HaystackOf<'a, I>>(
&self,
hay: impl IntoHaystack<'a, H>,
overlapping: bool,
) -> Vec<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>>
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.