Enlargeable

Trait Enlargeable 

Source
pub trait Enlargeable:
    Sized
    + Bounded
    + NumCast
    + Copy {
    type Larger: Copy + NumCast + Num + PartialOrd<Self::Larger> + Clone + Bounded + AddAssign + Zero;

    // Provided methods
    fn clamp_larger(n: Self::Larger) -> Self { ... }
    fn make_larger(self) -> Self::Larger { ... }
}
Expand description

An Enlargable::Larger value should be enough to calculate the sum (average) of a few hundred or thousand Enlargeable values.

Required Associated Types§

Source

type Larger: Copy + NumCast + Num + PartialOrd<Self::Larger> + Clone + Bounded + AddAssign + Zero

The larger type that can hold the sum of Self values.

Provided Methods§

Source

fn clamp_larger(n: Self::Larger) -> Self

Clamp a larger value to the range of the smaller type.

Source

fn make_larger(self) -> Self::Larger

Convert the value to a larger type.

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 Enlargeable for f32

Source§

impl Enlargeable for f64

Source§

impl Enlargeable for i8

Source§

impl Enlargeable for i16

Source§

impl Enlargeable for i32

Source§

impl Enlargeable for u8

Source§

impl Enlargeable for u16

Source§

impl Enlargeable for u32

Implementors§