pub struct IntervalSet { /* private fields */ }Expand description
A normalized set of inclusive code-point intervals.
Implementations§
Source§impl IntervalSet
impl IntervalSet
Sourcepub fn new(intervals: &[(u32, u32)]) -> Self
pub fn new(intervals: &[(u32, u32)]) -> Self
Normalize and build from possibly overlapping, unordered intervals.
Sourcepub fn from_range(low: u32, high: u32) -> Self
pub fn from_range(low: u32, high: u32) -> Self
An inclusive range, clamped to the Unicode bounds.
Sourcepub fn from_normalized(intervals: Vec<(u32, u32)>) -> Self
pub fn from_normalized(intervals: Vec<(u32, u32)>) -> Self
Build from already-normalized intervals without re-checking.
Sourcepub fn first_member(&self) -> Option<u32>
pub fn first_member(&self) -> Option<u32>
The smallest member, if any.
Sourcepub fn component_first_members(&self) -> Vec<u32>
pub fn component_first_members(&self) -> Vec<u32>
The first member of every component interval.
Sourcepub fn member_count(&self) -> u64
pub fn member_count(&self) -> u64
The total number of code points in the set.
Sourcepub fn union(&self, other: &IntervalSet) -> IntervalSet
pub fn union(&self, other: &IntervalSet) -> IntervalSet
Union (concatenate then renormalize).
Sourcepub fn intersection(&self, other: &IntervalSet) -> IntervalSet
pub fn intersection(&self, other: &IntervalSet) -> IntervalSet
Sweep-line intersection.
Sourcepub fn complement(&self) -> IntervalSet
pub fn complement(&self) -> IntervalSet
Every code point not in the set.
Sourcepub fn difference(&self, other: &IntervalSet) -> IntervalSet
pub fn difference(&self, other: &IntervalSet) -> IntervalSet
Members of self not in other.
Trait Implementations§
Source§impl Clone for IntervalSet
impl Clone for IntervalSet
Source§impl Debug for IntervalSet
impl Debug for IntervalSet
Source§impl Default for IntervalSet
impl Default for IntervalSet
impl Eq for IntervalSet
Source§impl Hash for IntervalSet
impl Hash for IntervalSet
Source§impl PartialEq for IntervalSet
impl PartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.