pub struct SweepPoint<T: GeoNum>(_);
Expand description
A lexicographically ordered point.
A wrapper around Coordinate
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 = Coordinate<T>>
Trait Implementations
sourceimpl<T: Clone + GeoNum> Clone for SweepPoint<T>
impl<T: Clone + GeoNum> Clone for SweepPoint<T>
sourcefn clone(&self) -> SweepPoint<T>
fn clone(&self) -> SweepPoint<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: GeoNum> Debug for SweepPoint<T>
impl<T: GeoNum> Debug for SweepPoint<T>
sourceimpl<T: GeoNum> Deref for SweepPoint<T>
impl<T: GeoNum> Deref for SweepPoint<T>
type Target = Coordinate<T>
type Target = Coordinate<T>
The resulting type after dereferencing.
sourceimpl<T: GeoNum> From<SweepPoint<T>> for LineOrPoint<T>
impl<T: GeoNum> From<SweepPoint<T>> for LineOrPoint<T>
sourcefn from(pt: SweepPoint<T>) -> Self
fn from(pt: SweepPoint<T>) -> Self
Converts to this type from the input type.
sourceimpl<T: GeoNum, X: Into<Coordinate<T>>> From<X> for SweepPoint<T>
impl<T: GeoNum, X: Into<Coordinate<T>>> From<X> for SweepPoint<T>
Conversion from type that can be converted to a Coordinate
.
sourceimpl<T: GeoNum> Ord for SweepPoint<T>
impl<T: GeoNum> Ord for SweepPoint<T>
Derive Ord
from PartialOrd
and expect to not fail.
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq + GeoNum> PartialEq<SweepPoint<T>> for SweepPoint<T>
impl<T: PartialEq + GeoNum> PartialEq<SweepPoint<T>> for SweepPoint<T>
sourcefn 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 ==
. Read more
sourceimpl<T: GeoNum> PartialOrd<SweepPoint<T>> for SweepPoint<T>
impl<T: GeoNum> PartialOrd<SweepPoint<T>> for SweepPoint<T>
Implement lexicographic ordering by x
and then by y
coordinate.
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more