pub struct Ranged<'a> { /* private fields */ }
Expand description
Regex syntax for matching an between the minimum and maximum number of occurrences of the input regex It accepts unbounded ranges. It also do not discriminate between open/closed ranges, and both works as including both ends.
§Example
use readable_regex::solvers::Ranged;
use readable_regex::ReadableRe::Raw;
let query = Ranged::new(3..5, Raw("abc"));
assert_eq!(query.to_string(), "abc{3,5}");
let query = Ranged::new(..5, Raw("abc"));
assert_eq!(query.to_string(), "abc{,5}");
let query = Ranged::new(3.., Raw("abc"));
assert_eq!(query.to_string(), "abc{3,}");
let query = Ranged::new(.., Raw("abc"));
assert_eq!(query.to_string(), "abc{,}");
Implementations§
Source§impl<'a> Ranged<'a>
impl<'a> Ranged<'a>
pub fn new<R>(range: R, re: ReadableRe<'a>) -> Selfwhere
R: RangeBounds<usize> + 'static,
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Ranged<'a>
impl<'a> RefUnwindSafe for Ranged<'a>
impl<'a> Send for Ranged<'a>
impl<'a> Sync for Ranged<'a>
impl<'a> Unpin for Ranged<'a>
impl<'a> UnwindSafe for Ranged<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more