pub struct IntervalSet { /* private fields */ }Expand description
Ordered set of integer intervals used by set and negated-set transitions.
Unicode grammars can contain very large ranges, so this stores normalized intervals rather than expanding every code point into a flat set.
Implementations§
Source§impl IntervalSet
impl IntervalSet
pub fn new() -> Self
pub fn from_range(start: i32, stop: i32) -> Self
pub fn add(&mut self, value: i32)
Sourcepub fn add_range(&mut self, start: i32, stop: i32)
pub fn add_range(&mut self, start: i32, stop: i32)
Adds an inclusive interval and merges it with adjacent or overlapping intervals.
Sourcepub fn contains(&self, value: i32) -> bool
pub fn contains(&self, value: i32) -> bool
Returns true when value falls inside any stored interval.
pub fn ranges(&self) -> &[(i32, i32)]
pub const fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for IntervalSet
impl Clone for IntervalSet
Source§fn clone(&self) -> IntervalSet
fn clone(&self) -> IntervalSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IntervalSet
impl Debug for IntervalSet
Source§impl Default for IntervalSet
impl Default for IntervalSet
Source§fn default() -> IntervalSet
fn default() -> IntervalSet
Returns the “default value” for a type. Read more
Source§impl PartialEq for IntervalSet
impl PartialEq for IntervalSet
Source§fn eq(&self, other: &IntervalSet) -> bool
fn eq(&self, other: &IntervalSet) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for IntervalSet
impl StructuralPartialEq for IntervalSet
Auto Trait Implementations§
impl Freeze for IntervalSet
impl RefUnwindSafe for IntervalSet
impl Send for IntervalSet
impl Sync for IntervalSet
impl Unpin for IntervalSet
impl UnsafeUnpin for IntervalSet
impl UnwindSafe for IntervalSet
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