Average

Trait Average 

Source
pub trait Average {
    // Required method
    fn average(value: Self, other: Self) -> Self;
}
Expand description

A trait to take the average of two values

Required Methods§

Source

fn average(value: Self, other: Self) -> Self

Calculate the average of two values.

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 Average for u8

Source§

fn average(value: Self, other: Self) -> Self

This rounds as integer division does: by flooring the result.

Source§

impl Average for u16

Source§

fn average(value: Self, other: Self) -> Self

This rounds as integer division does: by flooring the result.

Source§

impl Average for u32

Source§

fn average(value: Self, other: Self) -> Self

This rounds as integer division does: by flooring the result.

Source§

impl Average for u64

Source§

fn average(value: Self, other: Self) -> Self

This rounds as integer division does: by flooring the result.

Source§

impl Average for u128

Source§

fn average(value: Self, other: Self) -> Self

This rounds as integer division does: by flooring the result.

Implementors§