Skip to main content

Tally

Trait Tally 

Source
pub trait Tally:
    Copy
    + Default
    + Send
    + Sync {
    // Required methods
    fn add(self, y: Self) -> Self;
    fn low(n: i64) -> Self;
}
Expand description

An integer type that sums Terms, wrapping where a sum doesn’t fit: u8, i16, i32 or i64. A caller picks one that holds every sum it needs. A count of fewer than 256 Booleans fits a byte, which takes an eighth of the memory of an i64.

Required Methods§

Source

fn add(self, y: Self) -> Self

self + y, wrapping.

Source

fn low(n: i64) -> Self

The low bits of n.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Tally for i16

Source§

fn add(self, y: i16) -> i16

Source§

fn low(n: i64) -> i16

Source§

impl Tally for i32

Source§

fn add(self, y: i32) -> i32

Source§

fn low(n: i64) -> i32

Source§

impl Tally for i64

Source§

fn add(self, y: i64) -> i64

Source§

fn low(n: i64) -> i64

Source§

impl Tally for u8

Source§

fn add(self, y: u8) -> u8

Source§

fn low(n: i64) -> u8

Implementors§