pub struct OrdF64(pub f64);Expand description
A wrapper around f64 that implements Ord by using total_cmp.
This allows f64 values to be used in contexts requiring total ordering,
such as BinaryHeap, sorting, and other ordered collections.
§Examples
use ironbeam::utils::OrdF64;
use std::collections::BinaryHeap;
let mut heap = BinaryHeap::new();
heap.push(OrdF64(3.14));
heap.push(OrdF64(2.71));
heap.push(OrdF64(1.41));
assert_eq!(heap.pop().unwrap().0, 3.14);Tuple Fields§
§0: f64Trait Implementations§
Source§impl Ord for OrdF64
impl Ord for OrdF64
Source§impl PartialOrd for OrdF64
impl PartialOrd for OrdF64
impl Copy for OrdF64
impl Eq for OrdF64
impl StructuralPartialEq for OrdF64
Auto Trait Implementations§
impl Freeze for OrdF64
impl RefUnwindSafe for OrdF64
impl Send for OrdF64
impl Sync for OrdF64
impl Unpin for OrdF64
impl UnsafeUnpin for OrdF64
impl UnwindSafe for OrdF64
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more