ct_regex_internal/expr/
anon.rs1use crate::haystack::{HaystackItem, HaystackOf, IntoHaystack};
2use super::Regex;
3
4pub trait AnonRegex<I: HaystackItem, const N: usize>: Regex<I, N> {
11 fn is_match<'a, H: HaystackOf<'a, I>>(&self, hay: impl IntoHaystack<'a, H>) -> bool {
13 <Self as Regex<I, N>>::is_match(hay)
14 }
15
16 fn contains_match<'a, H: HaystackOf<'a, I>>(&self, hay: impl IntoHaystack<'a, H>) -> bool {
18 <Self as Regex<I, N>>::contains_match(hay)
19 }
20
21 fn slice_matching<'a, H: HaystackOf<'a, I>>(
23 &self,
24 hay: impl IntoHaystack<'a, H>
25 ) -> Option<H::Slice> {
26 <Self as Regex<I, N>>::slice_matching(hay)
27 }
28
29 fn slice_all_matching<'a, H: HaystackOf<'a, I>>(
31 &self,
32 hay: impl IntoHaystack<'a, H>,
33 overlapping: bool
34 ) -> Vec<H::Slice> {
35 <Self as Regex<I, N>>::slice_all_matching(hay, overlapping)
36 }
37
38 fn do_capture<'a, H: HaystackOf<'a, I>>(
40 &self,
41 hay: impl IntoHaystack<'a, H>
42 ) -> Option<Self::Capture<'a, H>> {
43 <Self as Regex<I, N>>::do_capture(hay)
44 }
45
46 fn find_capture<'a, H: HaystackOf<'a, I>>(
48 &self,
49 hay: impl IntoHaystack<'a, H>
50 ) -> Option<Self::Capture<'a, H>> {
51 <Self as Regex<I, N>>::find_capture(hay)
52 }
53
54 fn find_all_captures<'a, H: HaystackOf<'a, I>>(
56 &self,
57 hay: impl IntoHaystack<'a, H>,
58 overlapping: bool
59 ) -> Vec<Self::Capture<'a, H>> {
60 <Self as Regex<I, N>>::find_all_captures(hay, overlapping)
61 }
62}