Struct geo::algorithm::sweep::SweepPoint
source · pub struct SweepPoint<T: GeoNum>(/* private fields */);
Expand description
A lexicographically ordered point.
A wrapper around Coord
to order the point by x
, and then by y
.
Implements Ord
and Eq
, allowing usage in ordered collections such as
BinaryHeap
.
Note that the scalar type T
is only required to implement PartialOrd
.
Thus, it is a logical error to construct this struct unless the coords are
guaranteed to be orderable.
Methods from Deref<Target = Coord<T>>§
Trait Implementations§
source§impl<T: Clone + GeoNum> Clone for SweepPoint<T>
impl<T: Clone + GeoNum> Clone for SweepPoint<T>
source§fn clone(&self) -> SweepPoint<T>
fn clone(&self) -> SweepPoint<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: GeoNum> Debug for SweepPoint<T>
impl<T: GeoNum> Debug for SweepPoint<T>
source§impl<T: GeoNum> Deref for SweepPoint<T>
impl<T: GeoNum> Deref for SweepPoint<T>
source§impl<T: GeoNum> From<SweepPoint<T>> for LineOrPoint<T>
impl<T: GeoNum> From<SweepPoint<T>> for LineOrPoint<T>
source§fn from(pt: SweepPoint<T>) -> Self
fn from(pt: SweepPoint<T>) -> Self
Converts to this type from the input type.
source§impl<T: GeoNum, X: Into<Coord<T>>> From<X> for SweepPoint<T>
impl<T: GeoNum, X: Into<Coord<T>>> From<X> for SweepPoint<T>
Conversion from type that can be converted to a Coord
.
source§impl<T: GeoNum> Ord for SweepPoint<T>
impl<T: GeoNum> Ord for SweepPoint<T>
Derive Ord
from PartialOrd
and expect to not fail.
source§impl<T: PartialEq + GeoNum> PartialEq for SweepPoint<T>
impl<T: PartialEq + GeoNum> PartialEq for SweepPoint<T>
source§fn eq(&self, other: &SweepPoint<T>) -> bool
fn eq(&self, other: &SweepPoint<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: GeoNum> PartialOrd for SweepPoint<T>
impl<T: GeoNum> PartialOrd for SweepPoint<T>
Implement lexicographic ordering by x
and then by y
coordinate.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy + GeoNum> Copy for SweepPoint<T>
impl<T: GeoNum> Eq for SweepPoint<T>
We derive Eq
manually to not require T: Eq
.
impl<T: GeoNum> StructuralPartialEq for SweepPoint<T>
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§
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more