Skip to main content

Floor

Trait Floor 

Source
pub trait Floor: Sized {
    const ZERO: Self;
    const ONE: Self;

    // Required methods
    fn sub_to_floor(self, taken: Self) -> Self;
    fn add_to_ceiling(self, given: Self) -> Self;
    fn mul_to_ceiling(self, times: Self) -> Self;
    fn checked_div(self, by: Self) -> Option<Self>;
    fn checked_rem(self, by: Self) -> Option<Self>;
}

Required Associated Constants§

Source

const ZERO: Self

Source

const ONE: Self

Required Methods§

Source

fn sub_to_floor(self, taken: Self) -> Self

Source

fn add_to_ceiling(self, given: Self) -> Self

Source

fn mul_to_ceiling(self, times: Self) -> Self

Source

fn checked_div(self, by: Self) -> Option<Self>

Source

fn checked_rem(self, by: Self) -> Option<Self>

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

Source§

const ZERO: u8 = 0

Source§

const ONE: u8 = 1

Source§

fn sub_to_floor(self, taken: u8) -> u8

Source§

fn add_to_ceiling(self, given: u8) -> u8

Source§

fn mul_to_ceiling(self, times: u8) -> u8

Source§

fn checked_div(self, by: u8) -> Option<u8>

Source§

fn checked_rem(self, by: u8) -> Option<u8>

Source§

impl Floor for u16

Source§

const ZERO: u16 = 0

Source§

const ONE: u16 = 1

Source§

fn sub_to_floor(self, taken: u16) -> u16

Source§

fn add_to_ceiling(self, given: u16) -> u16

Source§

fn mul_to_ceiling(self, times: u16) -> u16

Source§

fn checked_div(self, by: u16) -> Option<u16>

Source§

fn checked_rem(self, by: u16) -> Option<u16>

Source§

impl Floor for u32

Source§

const ZERO: u32 = 0

Source§

const ONE: u32 = 1

Source§

fn sub_to_floor(self, taken: u32) -> u32

Source§

fn add_to_ceiling(self, given: u32) -> u32

Source§

fn mul_to_ceiling(self, times: u32) -> u32

Source§

fn checked_div(self, by: u32) -> Option<u32>

Source§

fn checked_rem(self, by: u32) -> Option<u32>

Source§

impl Floor for u64

Source§

const ZERO: u64 = 0

Source§

const ONE: u64 = 1

Source§

fn sub_to_floor(self, taken: u64) -> u64

Source§

fn add_to_ceiling(self, given: u64) -> u64

Source§

fn mul_to_ceiling(self, times: u64) -> u64

Source§

fn checked_div(self, by: u64) -> Option<u64>

Source§

fn checked_rem(self, by: u64) -> Option<u64>

Source§

impl Floor for u128

Source§

const ZERO: u128 = 0

Source§

const ONE: u128 = 1

Source§

fn sub_to_floor(self, taken: u128) -> u128

Source§

fn add_to_ceiling(self, given: u128) -> u128

Source§

fn mul_to_ceiling(self, times: u128) -> u128

Source§

fn checked_div(self, by: u128) -> Option<u128>

Source§

fn checked_rem(self, by: u128) -> Option<u128>

Source§

impl Floor for usize

Source§

const ZERO: usize = 0

Source§

const ONE: usize = 1

Source§

fn sub_to_floor(self, taken: usize) -> usize

Source§

fn add_to_ceiling(self, given: usize) -> usize

Source§

fn mul_to_ceiling(self, times: usize) -> usize

Source§

fn checked_div(self, by: usize) -> Option<usize>

Source§

fn checked_rem(self, by: usize) -> Option<usize>

Implementors§