devela::num

Trait PrimitiveCast

Source
pub trait PrimitiveCast {
Show 48 methods // Required methods fn checked_cast_to_u8(self) -> Result<u8>; fn checked_cast_to_u16(self) -> Result<u16>; fn checked_cast_to_u32(self) -> Result<u32>; fn checked_cast_to_u64(self) -> Result<u64>; fn checked_cast_to_u128(self) -> Result<u128>; fn checked_cast_to_usize(self) -> Result<usize>; fn checked_cast_to_usize_up(self) -> Result<usize_up>; fn checked_cast_to_usize_down(self) -> Result<usize_down>; fn checked_cast_to_i8(self) -> Result<i8>; fn checked_cast_to_i16(self) -> Result<i16>; fn checked_cast_to_i32(self) -> Result<i32>; fn checked_cast_to_i64(self) -> Result<i64>; fn checked_cast_to_i128(self) -> Result<i128>; fn checked_cast_to_isize(self) -> Result<isize>; fn checked_cast_to_isize_up(self) -> Result<isize_up>; fn checked_cast_to_isize_down(self) -> Result<isize_down>; fn saturating_cast_to_u8(self) -> u8 ; fn saturating_cast_to_u16(self) -> u16 ; fn saturating_cast_to_u32(self) -> u32 ; fn saturating_cast_to_u64(self) -> u64 ; fn saturating_cast_to_u128(self) -> u128 ; fn saturating_cast_to_usize(self) -> usize ; fn saturating_cast_to_usize_up(self) -> usize_up; fn saturating_cast_to_usize_down(self) -> usize_down; fn saturating_cast_to_i8(self) -> i8 ; fn saturating_cast_to_i16(self) -> i16 ; fn saturating_cast_to_i32(self) -> i32 ; fn saturating_cast_to_i64(self) -> i64 ; fn saturating_cast_to_i128(self) -> i128 ; fn saturating_cast_to_isize(self) -> isize ; fn saturating_cast_to_isize_up(self) -> isize_up; fn saturating_cast_to_isize_down(self) -> isize_down; fn wrapping_cast_to_u8(self) -> u8 ; fn wrapping_cast_to_u16(self) -> u16 ; fn wrapping_cast_to_u32(self) -> u32 ; fn wrapping_cast_to_u64(self) -> u64 ; fn wrapping_cast_to_u128(self) -> u128 ; fn wrapping_cast_to_usize(self) -> usize ; fn wrapping_cast_to_usize_up(self) -> usize_up; fn wrapping_cast_to_usize_down(self) -> usize_down; fn wrapping_cast_to_i8(self) -> i8 ; fn wrapping_cast_to_i16(self) -> i16 ; fn wrapping_cast_to_i32(self) -> i32 ; fn wrapping_cast_to_i64(self) -> i64 ; fn wrapping_cast_to_i128(self) -> i128 ; fn wrapping_cast_to_isize(self) -> isize ; fn wrapping_cast_to_isize_up(self) -> isize_up; fn wrapping_cast_to_isize_down(self) -> isize_down;
}
Available on crate feature cast only.
Expand description

Offers methods for casting between primitives.

See also the Cast type for the equivalent const methods.

§Errors

Checked methods will return Overflow if the original value can’t fit in the returned type.

Required Methods§

Source

fn checked_cast_to_u8(self) -> Result<u8>

Casts self to u8 with range check.

Source

fn checked_cast_to_u16(self) -> Result<u16>

Casts self to u16 with range check.

Source

fn checked_cast_to_u32(self) -> Result<u32>

Casts self to u32 with range check.

Source

fn checked_cast_to_u64(self) -> Result<u64>

Casts self to u64 with range check.

Source

fn checked_cast_to_u128(self) -> Result<u128>

Casts self to u128 with range check.

Source

fn checked_cast_to_usize(self) -> Result<usize>

Casts self to usize with range check.

Source

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Casts self to usize_up with range check.

Source

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Casts self to usize_down with range check.

Source

fn checked_cast_to_i8(self) -> Result<i8>

Casts self to i8 with range check.

Source

fn checked_cast_to_i16(self) -> Result<i16>

Casts self to i16 with range check.

Source

fn checked_cast_to_i32(self) -> Result<i32>

Casts self to i32 with range check.

Source

fn checked_cast_to_i64(self) -> Result<i64>

Casts self to i64 with range check.

Source

fn checked_cast_to_i128(self) -> Result<i128>

Casts self to i128 with range check.

Source

fn checked_cast_to_isize(self) -> Result<isize>

Casts self to isize with range check.

Source

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Casts self to isize_up with range check.

Source

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Casts self to isize_down with range check.

Source

fn saturating_cast_to_u8(self) -> u8

Casts self to u8 clamping at the numeric bounds.

Source

fn saturating_cast_to_u16(self) -> u16

Casts self to u16 clamping at the numeric bounds.

Source

fn saturating_cast_to_u32(self) -> u32

Casts self to u32 clamping at the numeric bounds.

Source

fn saturating_cast_to_u64(self) -> u64

Casts self to u64 clamping at the numeric bounds.

Source

fn saturating_cast_to_u128(self) -> u128

Casts self to u128 clamping at the numeric bounds.

Source

fn saturating_cast_to_usize(self) -> usize

Casts self to usize clamping at the numeric bounds.

Source

fn saturating_cast_to_usize_up(self) -> usize_up

Casts self to usize_up clamping at the numeric bounds.

Source

fn saturating_cast_to_usize_down(self) -> usize_down

Casts self to usize_down clamping at the numeric bounds.

Source

fn saturating_cast_to_i8(self) -> i8

Casts self to i8 clamping at the numeric bounds.

Source

fn saturating_cast_to_i16(self) -> i16

Casts self to i16 clamping at the numeric bounds.

Source

fn saturating_cast_to_i32(self) -> i32

Casts self to i32 clamping at the numeric bounds.

Source

fn saturating_cast_to_i64(self) -> i64

Casts self to i64 clamping at the numeric bounds.

Source

fn saturating_cast_to_i128(self) -> i128

Casts self to i128 clamping at the numeric bounds.

Source

fn saturating_cast_to_isize(self) -> isize

Casts self to isize clamping at the numeric bounds.

Source

fn saturating_cast_to_isize_up(self) -> isize_up

Casts self to isize_up clamping at the numeric bounds.

Source

fn saturating_cast_to_isize_down(self) -> isize_down

Casts self to isize_down clamping at the numeric bounds.

Source

fn wrapping_cast_to_u8(self) -> u8

Casts self to u8 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_u16(self) -> u16

Casts self to u16 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_u32(self) -> u32

Casts self to u32 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_u64(self) -> u64

Casts self to u64 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_u128(self) -> u128

Casts self to u128 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_usize(self) -> usize

Casts self to usize wrapping at the numeric bounds.

Source

fn wrapping_cast_to_usize_up(self) -> usize_up

Casts self to usize_up wrapping at the numeric bounds.

Source

fn wrapping_cast_to_usize_down(self) -> usize_down

Casts self to usize_down wrapping at the numeric bounds.

Source

fn wrapping_cast_to_i8(self) -> i8

Casts self to i8 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_i16(self) -> i16

Casts self to i16 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_i32(self) -> i32

Casts self to i32 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_i64(self) -> i64

Casts self to i64 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_i128(self) -> i128

Casts self to i128 wrapping at the numeric bounds.

Source

fn wrapping_cast_to_isize(self) -> isize

Casts self to isize wrapping at the numeric bounds.

Source

fn wrapping_cast_to_isize_up(self) -> isize_up

Casts self to isize_up wrapping at the numeric bounds.

Source

fn wrapping_cast_to_isize_down(self) -> isize_down

Casts self to isize_down wrapping at the numeric bounds.

Implementations on Foreign Types§

Source§

impl PrimitiveCast for i8

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for i16

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for i32

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for i64

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for i128

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for isize

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for u8

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for u16

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for u32

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for u64

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for u128

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Source§

impl PrimitiveCast for usize

Source§

fn checked_cast_to_u8(self) -> Result<u8>

Source§

fn checked_cast_to_u16(self) -> Result<u16>

Source§

fn checked_cast_to_u32(self) -> Result<u32>

Source§

fn checked_cast_to_u64(self) -> Result<u64>

Source§

fn checked_cast_to_u128(self) -> Result<u128>

Source§

fn checked_cast_to_usize(self) -> Result<usize>

Source§

fn checked_cast_to_usize_up(self) -> Result<usize_up>

Source§

fn checked_cast_to_usize_down(self) -> Result<usize_down>

Source§

fn checked_cast_to_i8(self) -> Result<i8>

Source§

fn checked_cast_to_i16(self) -> Result<i16>

Source§

fn checked_cast_to_i32(self) -> Result<i32>

Source§

fn checked_cast_to_i64(self) -> Result<i64>

Source§

fn checked_cast_to_i128(self) -> Result<i128>

Source§

fn checked_cast_to_isize(self) -> Result<isize>

Source§

fn checked_cast_to_isize_up(self) -> Result<isize_up>

Source§

fn checked_cast_to_isize_down(self) -> Result<isize_down>

Source§

fn saturating_cast_to_u8(self) -> u8

Source§

fn saturating_cast_to_u16(self) -> u16

Source§

fn saturating_cast_to_u32(self) -> u32

Source§

fn saturating_cast_to_u64(self) -> u64

Source§

fn saturating_cast_to_u128(self) -> u128

Source§

fn saturating_cast_to_usize(self) -> usize

Source§

fn saturating_cast_to_usize_up(self) -> usize_up

Source§

fn saturating_cast_to_usize_down(self) -> usize_down

Source§

fn saturating_cast_to_i8(self) -> i8

Source§

fn saturating_cast_to_i16(self) -> i16

Source§

fn saturating_cast_to_i32(self) -> i32

Source§

fn saturating_cast_to_i64(self) -> i64

Source§

fn saturating_cast_to_i128(self) -> i128

Source§

fn saturating_cast_to_isize(self) -> isize

Source§

fn saturating_cast_to_isize_up(self) -> isize_up

Source§

fn saturating_cast_to_isize_down(self) -> isize_down

Source§

fn wrapping_cast_to_u8(self) -> u8

Source§

fn wrapping_cast_to_u16(self) -> u16

Source§

fn wrapping_cast_to_u32(self) -> u32

Source§

fn wrapping_cast_to_u64(self) -> u64

Source§

fn wrapping_cast_to_u128(self) -> u128

Source§

fn wrapping_cast_to_usize(self) -> usize

Source§

fn wrapping_cast_to_usize_up(self) -> usize_up

Source§

fn wrapping_cast_to_usize_down(self) -> usize_down

Source§

fn wrapping_cast_to_i8(self) -> i8

Source§

fn wrapping_cast_to_i16(self) -> i16

Source§

fn wrapping_cast_to_i32(self) -> i32

Source§

fn wrapping_cast_to_i64(self) -> i64

Source§

fn wrapping_cast_to_i128(self) -> i128

Source§

fn wrapping_cast_to_isize(self) -> isize

Source§

fn wrapping_cast_to_isize_up(self) -> isize_up

Source§

fn wrapping_cast_to_isize_down(self) -> isize_down

Implementors§