Skip to main content

Averageable

Trait Averageable 

Source
pub trait Averageable:
    Copy
    + Default
    + Debug
    + AddAssign
    + Div<Output = Self> {
    // Required method
    fn from_count(count: usize) -> Self;
}
Expand description

Trait for types that can be used with RunningAverage.

Provides conversion from a usize count, needed to compute the average. Implemented for all standard numeric primitives.

Required Methods§

Source

fn from_count(count: usize) -> Self

Convert a usize count to Self.

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

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for f64

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for i8

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for i16

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for i32

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for i64

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for i128

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for isize

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for u8

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for u16

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for u32

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for u64

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for u128

Source§

fn from_count(count: usize) -> Self

Source§

impl Averageable for usize

Source§

fn from_count(count: usize) -> Self

Implementors§