Trait jumpy::prelude::egui::epaint::util::FloatOrd

pub trait FloatOrd {
    // Required method
    fn ord(self) -> OrderedFloat<Self>
       where Self: Sized;
}
Expand description

Extension trait to provide ord() method.

Example with f64:

use epaint::util::FloatOrd;

let array = [1.0, 2.5, 2.0];
let max = array.iter().max_by_key(|val| val.ord());

assert_eq!(max, Some(&2.5));

Required Methods§

fn ord(self) -> OrderedFloat<Self>
where Self: Sized,

Type to provide total order, useful as key in sorted contexts.

Implementations on Foreign Types§

§

impl FloatOrd for f32

§

fn ord(self) -> OrderedFloat<f32>

§

impl FloatOrd for f64

§

fn ord(self) -> OrderedFloat<f64>

Implementors§