Skip to main content

BoundedCastFromInt

Trait BoundedCastFromInt 

Source
pub trait BoundedCastFromInt<T>: SealedCast<T> {
    // Required methods
    fn wrapping_cast_from(value: T) -> Self;
    fn saturating_cast_from(value: T) -> Self;
}
Expand description

Conversion between integers, wrapping around or saturating at the target type’s boundaries.

Required Methods§

Source

fn wrapping_cast_from(value: T) -> Self

Converts value to this type, wrapping around at the boundary of the type.

Source

fn saturating_cast_from(value: T) -> Self

Converts value to this type, saturating at the numeric bounds instead of overflowing.

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 BoundedCastFromInt<i8> for i8

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for i16

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for i32

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for i64

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for i128

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for isize

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for u8

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for u16

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for u32

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for u64

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for u128

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i8> for usize

Source§

fn wrapping_cast_from(value: i8) -> Self

Source§

fn saturating_cast_from(value: i8) -> Self

Source§

impl BoundedCastFromInt<i16> for i8

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for i16

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for i32

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for i64

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for i128

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for isize

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for u8

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for u16

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for u32

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for u64

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for u128

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i16> for usize

Source§

fn wrapping_cast_from(value: i16) -> Self

Source§

fn saturating_cast_from(value: i16) -> Self

Source§

impl BoundedCastFromInt<i32> for i8

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for i16

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for i32

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for i64

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for i128

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for isize

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for u8

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for u16

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for u32

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for u64

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for u128

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i32> for usize

Source§

fn wrapping_cast_from(value: i32) -> Self

Source§

fn saturating_cast_from(value: i32) -> Self

Source§

impl BoundedCastFromInt<i64> for i8

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for i16

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for i32

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for i64

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for i128

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for isize

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for u8

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for u16

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for u32

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for u64

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for u128

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i64> for usize

Source§

fn wrapping_cast_from(value: i64) -> Self

Source§

fn saturating_cast_from(value: i64) -> Self

Source§

impl BoundedCastFromInt<i128> for i8

Source§

impl BoundedCastFromInt<i128> for i16

Source§

impl BoundedCastFromInt<i128> for i32

Source§

impl BoundedCastFromInt<i128> for i64

Source§

impl BoundedCastFromInt<i128> for i128

Source§

impl BoundedCastFromInt<i128> for isize

Source§

impl BoundedCastFromInt<i128> for u8

Source§

impl BoundedCastFromInt<i128> for u16

Source§

impl BoundedCastFromInt<i128> for u32

Source§

impl BoundedCastFromInt<i128> for u64

Source§

impl BoundedCastFromInt<i128> for u128

Source§

impl BoundedCastFromInt<i128> for usize

Source§

impl BoundedCastFromInt<isize> for i8

Source§

impl BoundedCastFromInt<isize> for i16

Source§

impl BoundedCastFromInt<isize> for i32

Source§

impl BoundedCastFromInt<isize> for i64

Source§

impl BoundedCastFromInt<isize> for i128

Source§

impl BoundedCastFromInt<isize> for isize

Source§

impl BoundedCastFromInt<isize> for u8

Source§

impl BoundedCastFromInt<isize> for u16

Source§

impl BoundedCastFromInt<isize> for u32

Source§

impl BoundedCastFromInt<isize> for u64

Source§

impl BoundedCastFromInt<isize> for u128

Source§

impl BoundedCastFromInt<isize> for usize

Source§

impl BoundedCastFromInt<u8> for i8

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for i16

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for i32

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for i64

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for i128

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for isize

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for u8

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for u16

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for u32

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for u64

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for u128

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u8> for usize

Source§

fn wrapping_cast_from(value: u8) -> Self

Source§

fn saturating_cast_from(value: u8) -> Self

Source§

impl BoundedCastFromInt<u16> for i8

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for i16

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for i32

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for i64

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for i128

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for isize

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for u8

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for u16

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for u32

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for u64

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for u128

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u16> for usize

Source§

fn wrapping_cast_from(value: u16) -> Self

Source§

fn saturating_cast_from(value: u16) -> Self

Source§

impl BoundedCastFromInt<u32> for i8

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for i16

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for i32

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for i64

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for i128

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for isize

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for u8

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for u16

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for u32

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for u64

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for u128

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u32> for usize

Source§

fn wrapping_cast_from(value: u32) -> Self

Source§

fn saturating_cast_from(value: u32) -> Self

Source§

impl BoundedCastFromInt<u64> for i8

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for i16

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for i32

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for i64

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for i128

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for isize

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for u8

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for u16

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for u32

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for u64

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for u128

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u64> for usize

Source§

fn wrapping_cast_from(value: u64) -> Self

Source§

fn saturating_cast_from(value: u64) -> Self

Source§

impl BoundedCastFromInt<u128> for i8

Source§

impl BoundedCastFromInt<u128> for i16

Source§

impl BoundedCastFromInt<u128> for i32

Source§

impl BoundedCastFromInt<u128> for i64

Source§

impl BoundedCastFromInt<u128> for i128

Source§

impl BoundedCastFromInt<u128> for isize

Source§

impl BoundedCastFromInt<u128> for u8

Source§

impl BoundedCastFromInt<u128> for u16

Source§

impl BoundedCastFromInt<u128> for u32

Source§

impl BoundedCastFromInt<u128> for u64

Source§

impl BoundedCastFromInt<u128> for u128

Source§

impl BoundedCastFromInt<u128> for usize

Source§

impl BoundedCastFromInt<usize> for i8

Source§

impl BoundedCastFromInt<usize> for i16

Source§

impl BoundedCastFromInt<usize> for i32

Source§

impl BoundedCastFromInt<usize> for i64

Source§

impl BoundedCastFromInt<usize> for i128

Source§

impl BoundedCastFromInt<usize> for isize

Source§

impl BoundedCastFromInt<usize> for u8

Source§

impl BoundedCastFromInt<usize> for u16

Source§

impl BoundedCastFromInt<usize> for u32

Source§

impl BoundedCastFromInt<usize> for u64

Source§

impl BoundedCastFromInt<usize> for u128

Source§

impl BoundedCastFromInt<usize> for usize

Implementors§