Struct geo_crossings::SweepPoint [−][src]
pub struct SweepPoint<T: GeoNum>(_);
Expand description
Wraps a Coordinate
to support lexicographic ordering.
The ordering is by x
and then by y
. Implements PartialOrd
,
Ord
and Eq
even though Coordinate
doesn’t implement these.
This is necessary to support insertion to ordered collections,
especially BinaryHeap
as required by sweep algorithms.
Note that the trait impls exist even when T
is not Eq
or
Ord
. We must ensure that any sweep point only contains values
that can be consistently ordered.
Implementations
Trait Implementations
Create from Coordinate
assuming the components are finite.
Performs the conversion.
Derive Ord
from PartialOrd
and expect to not fail.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Implememnt lexicographic ordering by x
and then by y
coordinate.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
We derive Eq
manually to not require T: Eq
.
Auto Trait Implementations
impl<T> RefUnwindSafe for SweepPoint<T> where
T: RefUnwindSafe,
impl<T> Send for SweepPoint<T> where
T: Send,
impl<T> Sync for SweepPoint<T> where
T: Sync,
impl<T> Unpin for SweepPoint<T> where
T: Unpin,
impl<T> UnwindSafe for SweepPoint<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more