pub enum Overlap {
Show 16 variants BothEmpty, FirstEmpty, SecondEmpty, Before, Meets, Overlaps, Starts, ContainedBy, Finishes, Equals, FinishedBy, Contains, StartedBy, OverlappedBy, MetBy, After,
}
Expand description

The overlapping state between intervals, returned by Interval::overlap.

Quick Reference

self relative to rhs:

                     rhs
                  c       d
                  β€’β€”β€”β€”β€”β€”β€”β€”β€’
     β”Œβ”€    a   b  :       :
     β”‚   B β€’β€”β€”β€”β€’  :       :
     β”‚      M β€’β€”β€”β€”β€’       :                              rhs
     β”‚        O β€’β€”β€”β€”β€’     :                              c=d
     β”‚          S β€’β€”β€”β€”β€’   :                               β€’
     β”‚          S β€’       :                  β”Œβ”€    a   b  :
     β”‚         Cb : β€’β€”β€”β€”β€’ :                  β”‚   B β€’β€”β€”β€”β€’  :
     β”‚            :   β€’β€”β€”β€”β€’ F                β”‚            β€’ E
self β”‚            :       β€’ F           self β”‚        β€’β€”β€”β€”β€’ Fb
     β”‚            β€’β€”β€”β€”β€”β€”β€”β€”β€’ E                β”‚          β€’β€”β€”β€”β€’ C
     β”‚          β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ Fb               β”‚            β€’β€”β€”β€”β€’ Sb
     β”‚          β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ C              β”‚            :  β€’β€”β€”β€”β€’ A
     β”‚            β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ Sb             └─           :  a   b
     β”‚            :     β€’β€”β€”β€”β€’ Ob                          β€’
     β”‚            :       β€’β€”β€”β€”β€’ Mb                       c=d
     β”‚            :       :  β€’β€”β€”β€”β€’ A
     └─           :       :  a   b
                  β€’β€”β€”β€”β€”β€”β€”β€”β€’
                  c       d

rhs relative to self:

                    self
                  a       b
                  β€’β€”β€”β€”β€”β€”β€”β€”β€’
     β”Œβ”€           :       :  c   d
     β”‚            :       :  β€’β€”β€”β€”β€’ B
     β”‚            :       β€’β€”β€”β€”β€’ M                       self
     β”‚            :     β€’β€”β€”β€”β€’ O                          a=b
     β”‚            β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ S                           β€’
     β”‚          β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ Cb             β”Œβ”€           :  c   d
     β”‚          β€’β€”β€”β€”β€”β€”β€”β€”β€”β€”β€’ F                β”‚            :  β€’β€”β€”β€”β€’ B
     β”‚            β€’β€”β€”β€”β€”β€”β€”β€”β€’ E                β”‚            β€’β€”β€”β€”β€’ S
 rhs β”‚            :   β€’β€”β€”β€”β€’ Fb           rhs β”‚          β€’β€”β€”β€”β€’ Cb
     β”‚            :       β€’ Fb               β”‚        β€’β€”β€”β€”β€’ F
     β”‚          C : β€’β€”β€”β€”β€’ :                  β”‚            β€’ E
     β”‚         Sb β€’β€”β€”β€”β€’   :                  β”‚   A β€’β€”β€”β€”β€’  :
     β”‚         Sb β€’       :                  └─    c   d  :
     β”‚       Ob β€’β€”β€”β€”β€’     :                               β€’
     β”‚     Mb β€’β€”β€”β€”β€’       :                              a=b
     β”‚   A β€’β€”β€”β€”β€’  :       :
     └─    c   d  :       :
                  β€’β€”β€”β€”β€”β€”β€”β€”β€’
                  a       b

Variants

BothEmpty

Both self and rhs are empty.

Equivalently, $\self = \rhs = βˆ…$.

FirstEmpty

self is empty while rhs is not.

Equivalently, $\self = βˆ… ∧ \rhs β‰  βˆ…$.

SecondEmpty

rhs is empty while self is not.

Equivalently, $\self β‰  βˆ… ∧ \rhs = βˆ…$.

Before

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $b < c$.

Equivalently,

$$ \self β‰  βˆ… ∧ \rhs β‰  βˆ… ∧ βˆ€x ∈ \self, βˆ€y ∈ \rhs : x < y. $$

       a      b
self:  β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:             β€’β€”β€”β€”β€”β€”β€”β€’
                  c      d

Inverse: Overlap::After.

Meets

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a < b ∧ b = c ∧ c < d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆ€x ∈ \self, βˆ€y ∈ \rhs : x ≀ y \\ &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : x < y \\ &∧ βˆƒx ∈ \self, βˆƒy ∈ \rhs : x = y. \end{align*} $$

       a      b
self:  β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:         β€’β€”β€”β€”β€”β€”β€”β€’
              c      d

Inverse: Overlap::MetBy.

Overlaps

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a < c ∧ c < b ∧ b < d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : x < y \\ &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : x < y \\ &∧ βˆƒx ∈ \self, βˆƒy ∈ \rhs : y < x. \end{align*} $$

       a      b
self:  β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:      β€’β€”β€”β€”β€”β€”β€”β€’
           c      d

Inverse: Overlap::OverlappedBy.

Starts

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a = c ∧ b < d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆ€y ∈ \rhs, βˆƒx ∈ \self : x ≀ y \\ &∧ βˆ€x ∈ \self, βˆƒy ∈ \rhs : y ≀ x \\ &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : x < y. \end{align*} $$

       a    b        :          a=b
self:  β€’β€”β€”β€”β€”β€’        :    self:  β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’    :     rhs:  β€’β€”β€”β€”β€”β€”β€”β€’
       c        d    :           c      d

Inverse: Overlap::StartedBy.

ContainedBy

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $c < a ∧ b < d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : y < x \\ &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : x < y. \end{align*} $$

         a    b
self:    β€’β€”β€”β€”β€”β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’
       c        d

Inverse: Overlap::Contains.

Finishes

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $c < a ∧ b = d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : y < x \\ &∧ βˆ€y ∈ \rhs, βˆƒx ∈ \self : y ≀ x \\ &∧ βˆ€x ∈ \self, βˆƒy ∈ \rhs : x ≀ y. \end{align*} $$

           a    b    :                 a=b
self:      β€’β€”β€”β€”β€”β€’    :    self:         β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’    :     rhs:  β€’β€”β€”β€”β€”β€”β€”β€’
       c        d    :           c      d

Inverse: Overlap::FinishedBy.

Equals

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a = c ∧ b = d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆ€x ∈ \self, βˆƒy ∈ \rhs : x = y \\ &∧ βˆ€y ∈ \rhs, βˆƒx ∈ \self : y = x. \end{align*} $$

       a      b    :          a=b
self:  β€’β€”β€”β€”β€”β€”β€”β€’    :    self:  β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€’    :     rhs:  β€’
       c      d    :          c=d

FinishedBy

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a < c ∧ b = d$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : x < y \\ &∧ βˆ€x ∈ \self, βˆƒy ∈ \rhs : x ≀ y \\ &∧ βˆ€y ∈ \rhs, βˆƒx ∈ \self : y ≀ x. \end{align*} $$

       a        b    :           a      b
self:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’    :    self:  β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:      β€’β€”β€”β€”β€”β€’    :     rhs:         β€’
           c    d    :                 c=d

Inverse: Overlap::Finishes.

Contains

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a < c ∧ d < b$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : x < y \\ &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : y < x. \end{align*} $$

       a        b
self:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’
 rhs:    β€’β€”β€”β€”β€”β€’
         c    d

Inverse: Overlap::ContainedBy.

StartedBy

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $a = c ∧ d < b$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆ€x ∈ \self, βˆƒy ∈ \rhs : y ≀ x \\ &∧ βˆ€y ∈ \rhs, βˆƒx ∈ \self : x ≀ y \\ &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : y < x. \end{align*} $$

       a        b    :           a      b
self:  β€’β€”β€”β€”β€”β€”β€”β€”β€”β€’    :    self:  β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:  β€’β€”β€”β€”β€”β€’        :     rhs:  β€’
       c    d        :          c=d

Inverse: Overlap::Starts.

OverlappedBy

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $c < a ∧ a < d ∧ d < b$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : y < x \\ &∧ βˆƒx ∈ \self, βˆ€y ∈ \rhs : y < x \\ &∧ βˆƒy ∈ \rhs, βˆƒx ∈ \self : x < y. \end{align*} $$

           a      b
self:      β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€’
       c      d

Inverse: Overlap::Overlaps.

MetBy

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $c < d ∧ a = d ∧ a < b$.

Equivalently,

$$ \begin{align*} \self β‰  βˆ… ∧ \rhs β‰  βˆ… &∧ βˆ€y ∈ \rhs, βˆ€x ∈ \self : y ≀ x \\ &∧ βˆƒy ∈ \rhs, βˆƒx ∈ \self : y = x \\ &∧ βˆƒy ∈ \rhs, βˆ€x ∈ \self : y < x. \end{align*} $$

              a      b
self:         β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€’
       c      d

Inverse: Overlap::Meets.

After

Both $\self = [a, b]$ and $rhs = [c, d]$ are nonempty and $d < a$.

Equivalently,

$$ \self β‰  βˆ… ∧ \rhs β‰  βˆ… ∧ βˆ€y ∈ \rhs, βˆ€x ∈ \self : y < x. $$

                  a      b
self:             β€’β€”β€”β€”β€”β€”β€”β€’
 rhs:  β€’β€”β€”β€”β€”β€”β€”β€’
       c      d

Inverse: Overlap::Before.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts the value.

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.