pub struct I64CO { /* private fields */ }Implementations§
Source§impl I64CO
impl I64CO
pub const fn try_new(start: i64, end_excl: i64) -> Option<Self>
pub const fn start(self) -> i64
pub const fn end_excl(self) -> i64
pub const fn end_incl(self) -> i64
pub const fn len(self) -> u64
pub const fn contains(self, x: i64) -> bool
pub const fn iter(self) -> Range<i64>
pub const fn to_range(self) -> Range<i64>
pub const fn intersects(self, other: Self) -> bool
pub const fn is_adjacent(self, other: Self) -> bool
pub const fn is_contiguous_with(self, other: Self) -> bool
Source§impl I64CO
impl I64CO
Sourcepub const fn intersection(self, other: Self) -> Option<Self>
pub const fn intersection(self, other: Self) -> Option<Self>
Returns the intersection of two intervals.
If the intervals do not overlap, returns None.
Sourcepub const fn convex_hull(self, other: Self) -> Self
pub const fn convex_hull(self, other: Self) -> Self
Returns the convex hull (smallest interval containing both) of two intervals.
Always returns a valid I64CO.
Sourcepub const fn between(self, other: Self) -> Option<Self>
pub const fn between(self, other: Self) -> Option<Self>
Returns the interval strictly between two intervals.
If the intervals are contiguous or overlap, returns None.
Sourcepub const fn union(self, other: Self) -> OneTwo<Self>
pub const fn union(self, other: Self) -> OneTwo<Self>
Returns the union of two intervals.
- If intervals are contiguous or overlapping, returns
Onecontaining the merged interval. - Otherwise, returns
Twocontaining both intervals in ascending order.
Sourcepub const fn difference(self, other: Self) -> ZeroOneTwo<Self>
pub const fn difference(self, other: Self) -> ZeroOneTwo<Self>
Returns the difference of two intervals (self - other).
- If no overlap, returns
One(self). - If partial overlap, returns
OneorTwodepending on remaining segments. - If fully contained, returns
Zero.
Sourcepub const fn symmetric_difference(self, other: Self) -> ZeroOneTwo<Self>
pub const fn symmetric_difference(self, other: Self) -> ZeroOneTwo<Self>
Returns the symmetric difference of two intervals.
Equivalent to (self - other) ∪ (other - self).
- If intervals do not overlap, returns
Two(self, other)in order. - If intervals partially overlap, returns remaining non-overlapping segments as
OneorTwo.
Source§impl I64CO
impl I64CO
pub const fn checked_minkowski_add(self, other: Self) -> Option<Self>
pub const fn checked_minkowski_sub(self, other: Self) -> Option<Self>
pub const fn checked_minkowski_mul(self, other: Self) -> Option<Self>
pub const fn checked_minkowski_div(self, other: Self) -> Option<Self>
Source§impl I64CO
impl I64CO
pub const fn checked_minkowski_add_n(self, n: i64) -> Option<Self>
pub const fn checked_minkowski_sub_n(self, n: i64) -> Option<Self>
pub const fn checked_minkowski_mul_n(self, n: i64) -> Option<Self>
pub const fn checked_minkowski_div_n(self, n: i64) -> Option<Self>
Source§impl I64CO
impl I64CO
pub const fn saturating_minkowski_add(self, other: Self) -> Option<Self>
pub const fn saturating_minkowski_sub(self, other: Self) -> Option<Self>
pub const fn saturating_minkowski_mul(self, other: Self) -> Option<Self>
pub const fn saturating_minkowski_div(self, other: Self) -> Option<Self>
Source§impl I64CO
impl I64CO
pub const fn saturating_minkowski_add_n(self, n: i64) -> Option<Self>
pub const fn saturating_minkowski_sub_n(self, n: i64) -> Option<Self>
pub const fn saturating_minkowski_mul_n(self, n: i64) -> Option<Self>
pub const fn saturating_minkowski_div_n(self, n: i64) -> Option<Self>
Trait Implementations§
impl Copy for I64CO
impl Eq for I64CO
impl StructuralPartialEq for I64CO
Auto Trait Implementations§
impl Freeze for I64CO
impl RefUnwindSafe for I64CO
impl Send for I64CO
impl Sync for I64CO
impl Unpin for I64CO
impl UnsafeUnpin for I64CO
impl UnwindSafe for I64CO
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