Trait regex_syntax::hir::interval::Interval [−][src]
pub trait Interval: Clone + Copy + Debug + Default + Eq + PartialEq + PartialOrd + Ord { type Bound: Bound; fn lower(&self) -> Self::Bound; fn upper(&self) -> Self::Bound; fn set_lower(&mut self, bound: Self::Bound); fn set_upper(&mut self, bound: Self::Bound); fn case_fold_simple(&self, intervals: &mut Vec<Self>); fn create(lower: Self::Bound, upper: Self::Bound) -> Self { ... } fn union(&self, other: &Self) -> Option<Self> { ... } fn intersect(&self, other: &Self) -> Option<Self> { ... } fn difference(&self, other: &Self) -> (Option<Self>, Option<Self>) { ... } fn symmetric_difference(&self, other: &Self) -> (Option<Self>, Option<Self>) { ... } fn is_contiguous(&self, other: &Self) -> bool { ... } fn is_intersection_empty(&self, other: &Self) -> bool { ... } fn is_subset(&self, other: &Self) -> bool { ... } }
Associated Types
Required Methods
fn lower(&self) -> Self::Bound
fn upper(&self) -> Self::Bound
fn set_lower(&mut self, bound: Self::Bound)
fn set_upper(&mut self, bound: Self::Bound)
fn case_fold_simple(&self, intervals: &mut Vec<Self>)
Provided Methods
fn create(lower: Self::Bound, upper: Self::Bound) -> Self
Create a new interval.
fn union(&self, other: &Self) -> Option<Self>
Union the given overlapping range into this range.
If the two ranges aren't contiguous, then this returns None
.
fn intersect(&self, other: &Self) -> Option<Self>
Intersect this range with the given range and return the result.
If the intersection is empty, then this returns None
.
fn difference(&self, other: &Self) -> (Option<Self>, Option<Self>)
Subtract the given range from this range and return the resulting ranges.
If subtraction would result in an empty range, then no ranges are returned.
fn symmetric_difference(&self, other: &Self) -> (Option<Self>, Option<Self>)
Compute the symmetric difference the given range from this range. This returns the union of the two ranges minus its intersection.
fn is_contiguous(&self, other: &Self) -> bool
Returns true if and only if the two ranges are contiguous. Two ranges are contiguous if and only if the ranges are either overlapping or adjacent.
fn is_intersection_empty(&self, other: &Self) -> bool
Returns true if and only if the intersection of this range and the other range is empty.
fn is_subset(&self, other: &Self) -> bool
Returns true if and only if this range is a subset of the other range.
Implementors
impl Interval for ClassUnicodeRange type Bound = char;
impl Interval for ClassBytesRange type Bound = u8;