SbInt

Trait SbInt 

Source
pub trait SbInt:
    Copy
    + Eq
    + PartialOrd
    + AddAssign
    + Add<Output = Self>
    + Mul<Output = Self>
    + Display
    + Debug {
    const ZERO: Self;
    const ONE: Self;
    const SIGNED: bool;

    // Required methods
    fn lt1(self, other: Self) -> bool;
    fn avg(self, other: Self) -> Self;
    fn abs(self) -> Self;
    fn neg(self) -> Self;
    fn steps(self, from: (Self, Self), to: (Self, Self)) -> Self;
    fn lowest_frac() -> (Self, Self);
    fn highest_frac() -> (Self, Self);
    fn zero_frac() -> (Self, Self);
}

Required Associated Constants§

Source

const ZERO: Self

Source

const ONE: Self

Source

const SIGNED: bool

Required Methods§

Source

fn lt1(self, other: Self) -> bool

Source

fn avg(self, other: Self) -> Self

Source

fn abs(self) -> Self

Source

fn neg(self) -> Self

Source

fn steps(self, from: (Self, Self), to: (Self, Self)) -> Self

Source

fn lowest_frac() -> (Self, Self)

Source

fn highest_frac() -> (Self, Self)

Source

fn zero_frac() -> (Self, 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 SbInt for i8

Source§

const ZERO: i8 = 0i8

Source§

const ONE: i8 = 1i8

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: i8) -> bool

Source§

fn avg(self, other: i8) -> i8

Source§

fn abs(self) -> i8

Source§

fn neg(self) -> i8

Source§

fn steps(self, from: (i8, i8), to: (i8, i8)) -> i8

Source§

fn lowest_frac() -> (i8, i8)

Source§

fn highest_frac() -> (i8, i8)

Source§

fn zero_frac() -> (i8, i8)

Source§

impl SbInt for i16

Source§

const ZERO: i16 = 0i16

Source§

const ONE: i16 = 1i16

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: i16) -> bool

Source§

fn avg(self, other: i16) -> i16

Source§

fn abs(self) -> i16

Source§

fn neg(self) -> i16

Source§

fn steps(self, from: (i16, i16), to: (i16, i16)) -> i16

Source§

fn lowest_frac() -> (i16, i16)

Source§

fn highest_frac() -> (i16, i16)

Source§

fn zero_frac() -> (i16, i16)

Source§

impl SbInt for i32

Source§

const ZERO: i32 = 0i32

Source§

const ONE: i32 = 1i32

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: i32) -> bool

Source§

fn avg(self, other: i32) -> i32

Source§

fn abs(self) -> i32

Source§

fn neg(self) -> i32

Source§

fn steps(self, from: (i32, i32), to: (i32, i32)) -> i32

Source§

fn lowest_frac() -> (i32, i32)

Source§

fn highest_frac() -> (i32, i32)

Source§

fn zero_frac() -> (i32, i32)

Source§

impl SbInt for i64

Source§

const ZERO: i64 = 0i64

Source§

const ONE: i64 = 1i64

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: i64) -> bool

Source§

fn avg(self, other: i64) -> i64

Source§

fn abs(self) -> i64

Source§

fn neg(self) -> i64

Source§

fn steps(self, from: (i64, i64), to: (i64, i64)) -> i64

Source§

fn lowest_frac() -> (i64, i64)

Source§

fn highest_frac() -> (i64, i64)

Source§

fn zero_frac() -> (i64, i64)

Source§

impl SbInt for i128

Source§

const ZERO: i128 = 0i128

Source§

const ONE: i128 = 1i128

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: i128) -> bool

Source§

fn avg(self, other: i128) -> i128

Source§

fn abs(self) -> i128

Source§

fn neg(self) -> i128

Source§

fn steps(self, from: (i128, i128), to: (i128, i128)) -> i128

Source§

fn lowest_frac() -> (i128, i128)

Source§

fn highest_frac() -> (i128, i128)

Source§

fn zero_frac() -> (i128, i128)

Source§

impl SbInt for isize

Source§

const ZERO: isize = 0isize

Source§

const ONE: isize = 1isize

Source§

const SIGNED: bool = true

Source§

fn lt1(self, other: isize) -> bool

Source§

fn avg(self, other: isize) -> isize

Source§

fn abs(self) -> isize

Source§

fn neg(self) -> isize

Source§

fn steps(self, from: (isize, isize), to: (isize, isize)) -> isize

Source§

fn lowest_frac() -> (isize, isize)

Source§

fn highest_frac() -> (isize, isize)

Source§

fn zero_frac() -> (isize, isize)

Source§

impl SbInt for u8

Source§

const ZERO: u8 = 0u8

Source§

const ONE: u8 = 1u8

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: u8) -> bool

Source§

fn avg(self, other: u8) -> u8

Source§

fn abs(self) -> u8

Source§

fn neg(self) -> u8

Source§

fn steps(self, from: (u8, u8), to: (u8, u8)) -> u8

Source§

fn lowest_frac() -> (u8, u8)

Source§

fn highest_frac() -> (u8, u8)

Source§

fn zero_frac() -> (u8, u8)

Source§

impl SbInt for u16

Source§

const ZERO: u16 = 0u16

Source§

const ONE: u16 = 1u16

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: u16) -> bool

Source§

fn avg(self, other: u16) -> u16

Source§

fn abs(self) -> u16

Source§

fn neg(self) -> u16

Source§

fn steps(self, from: (u16, u16), to: (u16, u16)) -> u16

Source§

fn lowest_frac() -> (u16, u16)

Source§

fn highest_frac() -> (u16, u16)

Source§

fn zero_frac() -> (u16, u16)

Source§

impl SbInt for u32

Source§

const ZERO: u32 = 0u32

Source§

const ONE: u32 = 1u32

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: u32) -> bool

Source§

fn avg(self, other: u32) -> u32

Source§

fn abs(self) -> u32

Source§

fn neg(self) -> u32

Source§

fn steps(self, from: (u32, u32), to: (u32, u32)) -> u32

Source§

fn lowest_frac() -> (u32, u32)

Source§

fn highest_frac() -> (u32, u32)

Source§

fn zero_frac() -> (u32, u32)

Source§

impl SbInt for u64

Source§

const ZERO: u64 = 0u64

Source§

const ONE: u64 = 1u64

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: u64) -> bool

Source§

fn avg(self, other: u64) -> u64

Source§

fn abs(self) -> u64

Source§

fn neg(self) -> u64

Source§

fn steps(self, from: (u64, u64), to: (u64, u64)) -> u64

Source§

fn lowest_frac() -> (u64, u64)

Source§

fn highest_frac() -> (u64, u64)

Source§

fn zero_frac() -> (u64, u64)

Source§

impl SbInt for u128

Source§

const ZERO: u128 = 0u128

Source§

const ONE: u128 = 1u128

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: u128) -> bool

Source§

fn avg(self, other: u128) -> u128

Source§

fn abs(self) -> u128

Source§

fn neg(self) -> u128

Source§

fn steps(self, from: (u128, u128), to: (u128, u128)) -> u128

Source§

fn lowest_frac() -> (u128, u128)

Source§

fn highest_frac() -> (u128, u128)

Source§

fn zero_frac() -> (u128, u128)

Source§

impl SbInt for usize

Source§

const ZERO: usize = 0usize

Source§

const ONE: usize = 1usize

Source§

const SIGNED: bool = false

Source§

fn lt1(self, other: usize) -> bool

Source§

fn avg(self, other: usize) -> usize

Source§

fn abs(self) -> usize

Source§

fn neg(self) -> usize

Source§

fn steps(self, from: (usize, usize), to: (usize, usize)) -> usize

Source§

fn lowest_frac() -> (usize, usize)

Source§

fn highest_frac() -> (usize, usize)

Source§

fn zero_frac() -> (usize, usize)

Implementors§