Binnable

Trait Binnable 

Source
pub trait Binnable:
    PartialEq
    + PartialOrd
    + Add
    + Sub
    + Sized {
    // Required methods
    fn multiply(&self, rhs: usize) -> Self;
    fn divide(&self, rhs: usize) -> Self;
}
Expand description

Allows a type T to be used as the primary dimension of a Histogram. Consumers may choose to implement this to bin non-standard types in a histogram.

Required Methods§

Source

fn multiply(&self, rhs: usize) -> Self

Multiply this value (self: T) by the rhs: usize, resulting in another T.

Notice: For whole types T (types that belong to ℤ) the resulting value must be rounded up. In other words, implement multiply using ceil for integer types.

Source

fn divide(&self, rhs: usize) -> Self

Divide this value (self: T) by the rhs: usize, resulting in another T.

Notice: For whole types T (types that belong to ℤ) the resulting value must be rounded up. In other words, implement divide using ceil for integer types.

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

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for f64

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for i8

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for i16

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for i32

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for i64

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for isize

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for u8

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for u16

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for u32

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for u64

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Source§

impl Binnable for usize

Source§

fn multiply(&self, rhs: usize) -> Self

Source§

fn divide(&self, rhs: usize) -> Self

Implementors§