Skip to main content

CastFromInt

Trait CastFromInt 

Source
pub trait CastFromInt<T>: SealedCast<T> {
    // Required method
    fn cast_from(value: T) -> Self;
}
Expand description

Infallible conversion between integers.

Required Methods§

Source

fn cast_from(value: T) -> Self

Converts value to this type.

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

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i8> for i16

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i8> for i32

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i8> for i64

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i8> for i128

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i8> for isize

Source§

fn cast_from(value: i8) -> Self

Source§

impl CastFromInt<i16> for i16

Source§

fn cast_from(value: i16) -> Self

Source§

impl CastFromInt<i16> for i32

Source§

fn cast_from(value: i16) -> Self

Source§

impl CastFromInt<i16> for i64

Source§

fn cast_from(value: i16) -> Self

Source§

impl CastFromInt<i16> for i128

Source§

fn cast_from(value: i16) -> Self

Source§

impl CastFromInt<i16> for isize

Source§

fn cast_from(value: i16) -> Self

Source§

impl CastFromInt<i32> for i32

Source§

fn cast_from(value: i32) -> Self

Source§

impl CastFromInt<i32> for i64

Source§

fn cast_from(value: i32) -> Self

Source§

impl CastFromInt<i32> for i128

Source§

fn cast_from(value: i32) -> Self

Source§

impl CastFromInt<i64> for i64

Source§

fn cast_from(value: i64) -> Self

Source§

impl CastFromInt<i64> for i128

Source§

fn cast_from(value: i64) -> Self

Source§

impl CastFromInt<i128> for i128

Source§

fn cast_from(value: i128) -> Self

Source§

impl CastFromInt<isize> for isize

Source§

fn cast_from(value: isize) -> Self

Source§

impl CastFromInt<u8> for i16

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for i32

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for i64

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for i128

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for isize

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for u8

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for u16

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for u32

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for u64

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for u128

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u8> for usize

Source§

fn cast_from(value: u8) -> Self

Source§

impl CastFromInt<u16> for i32

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for i64

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for i128

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for u16

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for u32

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for u64

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for u128

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u16> for usize

Source§

fn cast_from(value: u16) -> Self

Source§

impl CastFromInt<u32> for i64

Source§

fn cast_from(value: u32) -> Self

Source§

impl CastFromInt<u32> for i128

Source§

fn cast_from(value: u32) -> Self

Source§

impl CastFromInt<u32> for u32

Source§

fn cast_from(value: u32) -> Self

Source§

impl CastFromInt<u32> for u64

Source§

fn cast_from(value: u32) -> Self

Source§

impl CastFromInt<u32> for u128

Source§

fn cast_from(value: u32) -> Self

Source§

impl CastFromInt<u64> for i128

Source§

fn cast_from(value: u64) -> Self

Source§

impl CastFromInt<u64> for u64

Source§

fn cast_from(value: u64) -> Self

Source§

impl CastFromInt<u64> for u128

Source§

fn cast_from(value: u64) -> Self

Source§

impl CastFromInt<u128> for u128

Source§

fn cast_from(value: u128) -> Self

Source§

impl CastFromInt<usize> for usize

Source§

fn cast_from(value: usize) -> Self

Implementors§