gix_utils::btoi

Trait MinNumTraits

source
pub trait MinNumTraits:
    Sized
    + Copy
    + TryFrom<u32> {
    const ZERO: Self;

    // Required methods
    fn checked_mul(self, rhs: Self) -> Option<Self>;
    fn checked_add(self, rhs: Self) -> Option<Self>;
    fn checked_sub(self, v: Self) -> Option<Self>;

    // Provided method
    fn from_u32(n: u32) -> Option<Self> { ... }
}
Expand description

minimal subset of traits used by to_signed_with_radix and to_unsigned_with_radix

Required Associated Constants§

source

const ZERO: Self

the 0 value for this type

Required Methods§

source

fn checked_mul(self, rhs: Self) -> Option<Self>

the checked multiplication operation for this type

source

fn checked_add(self, rhs: Self) -> Option<Self>

the chekced addition operation for this type

source

fn checked_sub(self, v: Self) -> Option<Self>

the checked subtraction operation for this type

Provided Methods§

source

fn from_u32(n: u32) -> Option<Self>

convert from a unsigned 32-bit word

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 MinNumTraits for i32

source§

const ZERO: Self = 0i32

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

impl MinNumTraits for i64

source§

const ZERO: Self = 0i64

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

impl MinNumTraits for u8

source§

const ZERO: Self = 0u8

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

impl MinNumTraits for u64

source§

const ZERO: Self = 0u64

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

impl MinNumTraits for usize

source§

const ZERO: Self = 0usize

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_mul(self, rhs: Self) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

Implementors§