Trait MaxMin

Source
pub trait MaxMin: PartialOrd {
    // Required methods
    fn get_max(self, other: Self) -> Self;
    fn get_min(self, other: Self) -> Self;
    fn non_zero_positive_min_value() -> Self;
}

Required Methods§

Source

fn get_max(self, other: Self) -> Self

Returns the maximum of two numbers.

§Examples
use hyperloglog_rs::prelude::*;

let max = 2.0_f32.max(3.0_f32);

assert_eq!(max, 3.0_f32);
Source

fn get_min(self, other: Self) -> Self

Returns the minimum of two numbers.

§Examples
use hyperloglog_rs::prelude::*;

let min = 2.0_f32.min(3.0_f32);

assert_eq!(min, 2.0_f32);
Source

fn non_zero_positive_min_value() -> Self

Returns the non-zero positive minimum value that can be represented by this type.

§Examples
use hyperloglog_rs::prelude::*;

let min = f32::non_zero_positive_min_value();

assert_eq!(min, f32::EPSILON);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MaxMin for f32

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for f64

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for i8

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for i16

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for i32

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for i64

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for i128

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for u8

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for u16

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for u32

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for u64

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for u128

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Source§

impl MaxMin for usize

Source§

fn get_max(self, other: Self) -> Self

Source§

fn get_min(self, other: Self) -> Self

Source§

fn non_zero_positive_min_value() -> Self

Implementors§