#[repr(transparent)]pub struct Cast<T>(pub T);
prim···
only.Expand description
Provides const casting, joining and splitting operations between primitives.
See also the related traits: [PrimitiveCast
], [PrimitiveJoin
] and [PrimitiveSplit
].
Tuple Fields§
§0: T
Implementations§
Source§impl Cast<u8>
Checked casts and saturating casts.
impl Cast<u8>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from u8
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from u8
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from u8
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from u8
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from u8
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from u8
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from u8
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from u8
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from u8
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from u8
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from u8
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from u8
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from u8
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from u8
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from u8
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from u8
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u8
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u8
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u8
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u8
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u8
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u8
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u8
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u8
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u8
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u8
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u8
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u8
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u8
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u8
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u8
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u8
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u8
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u8
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u8
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u8
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u8
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u8
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u8
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u8
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u8
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u8
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u8
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u8
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u8
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u8
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u8
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u8
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<u16>
Checked casts and saturating casts.
impl Cast<u16>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from u16
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from u16
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from u16
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from u16
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from u16
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from u16
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from u16
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from u16
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from u16
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from u16
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from u16
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from u16
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from u16
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from u16
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from u16
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from u16
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u16
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u16
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u16
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u16
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u16
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u16
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u16
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u16
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u16
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u16
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u16
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u16
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u16
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u16
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u16
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u16
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u16
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u16
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u16
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u16
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u16
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u16
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u16
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u16
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u16
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u16
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u16
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u16
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u16
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u16
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u16
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u16
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<u32>
Checked casts and saturating casts.
impl Cast<u32>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from u32
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from u32
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from u32
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from u32
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from u32
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from u32
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from u32
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from u32
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from u32
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from u32
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from u32
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from u32
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from u32
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from u32
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from u32
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from u32
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u32
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u32
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u32
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u32
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u32
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u32
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u32
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u32
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u32
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u32
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u32
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u32
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u32
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u32
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u32
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u32
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u32
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u32
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u32
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u32
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u32
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u32
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u32
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u32
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u32
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u32
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u32
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u32
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u32
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u32
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u32
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u32
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<u64>
Checked casts and saturating casts.
impl Cast<u64>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from u64
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from u64
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from u64
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from u64
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from u64
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from u64
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from u64
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from u64
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from u64
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from u64
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from u64
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from u64
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from u64
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from u64
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from u64
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from u64
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u64
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u64
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u64
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u64
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u64
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u64
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u64
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u64
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u64
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u64
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u64
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u64
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u64
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u64
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u64
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u64
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u64
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u64
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u64
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u64
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u64
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u64
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u64
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u64
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u64
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u64
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u64
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u64
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u64
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u64
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u64
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u64
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<u128>
Checked casts and saturating casts.
impl Cast<u128>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from u128
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from u128
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from u128
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from u128
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from u128
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from u128
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from u128
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from u128
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from u128
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from u128
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from u128
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from u128
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from u128
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from u128
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from u128
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from u128
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u128
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u128
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u128
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u128
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u128
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u128
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u128
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u128
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u128
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u128
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u128
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u128
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u128
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u128
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u128
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u128
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from u128
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from u128
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from u128
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from u128
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from u128
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from u128
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from u128
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from u128
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from u128
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from u128
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from u128
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from u128
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from u128
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from u128
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from u128
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from u128
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<usize>
Checked casts and saturating casts.
impl Cast<usize>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from usize
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from usize
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from usize
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from usize
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from usize
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from usize
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from usize
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from usize
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from usize
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from usize
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from usize
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from usize
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from usize
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from usize
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from usize
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from usize
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from usize
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from usize
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from usize
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from usize
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from usize
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from usize
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from usize
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from usize
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from usize
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from usize
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from usize
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from usize
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from usize
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from usize
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from usize
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from usize
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from usize
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from usize
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from usize
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from usize
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from usize
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from usize
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from usize
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from usize
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from usize
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from usize
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from usize
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from usize
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from usize
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from usize
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from usize
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from usize
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<i8>
Checked casts and saturating casts.
impl Cast<i8>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from i8
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from i8
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from i8
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from i8
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from i8
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from i8
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from i8
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from i8
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from i8
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from i8
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from i8
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from i8
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from i8
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from i8
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from i8
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from i8
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i8
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i8
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i8
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i8
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i8
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i8
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i8
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i8
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i8
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i8
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i8
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i8
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i8
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i8
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i8
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i8
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i8
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i8
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i8
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i8
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i8
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i8
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i8
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i8
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i8
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i8
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i8
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i8
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i8
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i8
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i8
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i8
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<i16>
Checked casts and saturating casts.
impl Cast<i16>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from i16
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from i16
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from i16
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from i16
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from i16
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from i16
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from i16
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from i16
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from i16
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from i16
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from i16
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from i16
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from i16
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from i16
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from i16
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from i16
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i16
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i16
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i16
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i16
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i16
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i16
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i16
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i16
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i16
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i16
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i16
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i16
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i16
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i16
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i16
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i16
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i16
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i16
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i16
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i16
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i16
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i16
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i16
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i16
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i16
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i16
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i16
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i16
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i16
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i16
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i16
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i16
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<i32>
Checked casts and saturating casts.
impl Cast<i32>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from i32
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from i32
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from i32
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from i32
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from i32
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from i32
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from i32
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from i32
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from i32
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from i32
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from i32
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from i32
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from i32
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from i32
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from i32
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from i32
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i32
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i32
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i32
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i32
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i32
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i32
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i32
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i32
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i32
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i32
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i32
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i32
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i32
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i32
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i32
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i32
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i32
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i32
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i32
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i32
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i32
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i32
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i32
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i32
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i32
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i32
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i32
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i32
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i32
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i32
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i32
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i32
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<i64>
Checked casts and saturating casts.
impl Cast<i64>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from i64
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from i64
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from i64
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from i64
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from i64
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from i64
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from i64
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from i64
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from i64
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from i64
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from i64
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from i64
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from i64
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from i64
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from i64
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from i64
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i64
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i64
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i64
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i64
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i64
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i64
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i64
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i64
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i64
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i64
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i64
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i64
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i64
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i64
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i64
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i64
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i64
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i64
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i64
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i64
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i64
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i64
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i64
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i64
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i64
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i64
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i64
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i64
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i64
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i64
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i64
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i64
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<i128>
Checked casts and saturating casts.
impl Cast<i128>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from i128
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from i128
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from i128
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from i128
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from i128
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from i128
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from i128
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from i128
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from i128
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from i128
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from i128
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from i128
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from i128
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from i128
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from i128
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from i128
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i128
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i128
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i128
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i128
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i128
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i128
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i128
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i128
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i128
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i128
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i128
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i128
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i128
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i128
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i128
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i128
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from i128
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from i128
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from i128
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from i128
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from i128
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from i128
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from i128
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from i128
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from i128
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from i128
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from i128
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from i128
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from i128
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from i128
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from i128
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from i128
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<isize>
Checked casts and saturating casts.
impl Cast<isize>
Checked casts and saturating casts.
Sourcepub const fn checked_cast_to_u8(self) -> Result<u8>
Available on crate feature cast
only.
pub const fn checked_cast_to_u8(self) -> Result<u8>
cast
only.Casts from isize
to u8
with range check.
Sourcepub const fn checked_cast_to_u16(self) -> Result<u16>
Available on crate feature cast
only.
pub const fn checked_cast_to_u16(self) -> Result<u16>
cast
only.Casts from isize
to u16
with range check.
Sourcepub const fn checked_cast_to_u32(self) -> Result<u32>
Available on crate feature cast
only.
pub const fn checked_cast_to_u32(self) -> Result<u32>
cast
only.Casts from isize
to u32
with range check.
Sourcepub const fn checked_cast_to_u64(self) -> Result<u64>
Available on crate feature cast
only.
pub const fn checked_cast_to_u64(self) -> Result<u64>
cast
only.Casts from isize
to u64
with range check.
Sourcepub const fn checked_cast_to_u128(self) -> Result<u128>
Available on crate feature cast
only.
pub const fn checked_cast_to_u128(self) -> Result<u128>
cast
only.Casts from isize
to u128
with range check.
Sourcepub const fn checked_cast_to_usize(self) -> Result<usize>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize(self) -> Result<usize>
cast
only.Casts from isize
to usize
with range check.
Sourcepub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_up(self) -> Result<usize_up>
cast
only.Casts from isize
to usize_up
with range check.
Sourcepub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_usize_down(self) -> Result<usize_down>
cast
only.Casts from isize
to usize_down
with range check.
Sourcepub const fn checked_cast_to_i8(self) -> Result<i8>
Available on crate feature cast
only.
pub const fn checked_cast_to_i8(self) -> Result<i8>
cast
only.Casts from isize
to i8
with range check.
Sourcepub const fn checked_cast_to_i16(self) -> Result<i16>
Available on crate feature cast
only.
pub const fn checked_cast_to_i16(self) -> Result<i16>
cast
only.Casts from isize
to i16
with range check.
Sourcepub const fn checked_cast_to_i32(self) -> Result<i32>
Available on crate feature cast
only.
pub const fn checked_cast_to_i32(self) -> Result<i32>
cast
only.Casts from isize
to i32
with range check.
Sourcepub const fn checked_cast_to_i64(self) -> Result<i64>
Available on crate feature cast
only.
pub const fn checked_cast_to_i64(self) -> Result<i64>
cast
only.Casts from isize
to i64
with range check.
Sourcepub const fn checked_cast_to_i128(self) -> Result<i128>
Available on crate feature cast
only.
pub const fn checked_cast_to_i128(self) -> Result<i128>
cast
only.Casts from isize
to i128
with range check.
Sourcepub const fn checked_cast_to_isize(self) -> Result<isize>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize(self) -> Result<isize>
cast
only.Casts from isize
to isize
with range check.
Sourcepub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_up(self) -> Result<isize_up>
cast
only.Casts from isize
to isize_up
with range check.
Sourcepub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
Available on crate feature cast
only.
pub const fn checked_cast_to_isize_down(self) -> Result<isize_down>
cast
only.Casts from isize
to isize_down
with range check.
Sourcepub const fn saturating_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from isize
to u8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from isize
to u16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from isize
to u32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from isize
to u64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from isize
to u128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from isize
to usize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_up(self) -> usize_up
cast
only.Casts from isize
to usize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_usize_down(self) -> usize_down
cast
only.Casts from isize
to usize_down
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from isize
to i8
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from isize
to i16
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from isize
to i32
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from isize
to i64
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from isize
to i128
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from isize
to isize
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_up(self) -> isize_up
cast
only.Casts from isize
to isize_up
clamping at the numeric bounds.
Sourcepub const fn saturating_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn saturating_cast_to_isize_down(self) -> isize_down
cast
only.Casts from isize
to isize_down
clamping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u8(self) -> u8 ⓘ
cast
only.Casts from isize
to u8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u16(self) -> u16 ⓘ
cast
only.Casts from isize
to u16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u32(self) -> u32 ⓘ
cast
only.Casts from isize
to u32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u64(self) -> u64 ⓘ
cast
only.Casts from isize
to u64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_u128(self) -> u128 ⓘ
cast
only.Casts from isize
to u128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize(self) -> usize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize(self) -> usize ⓘ
cast
only.Casts from isize
to usize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_up(self) -> usize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_up(self) -> usize_up
cast
only.Casts from isize
to usize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_usize_down(self) -> usize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_usize_down(self) -> usize_down
cast
only.Casts from isize
to usize_down
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i8(self) -> i8 ⓘ
cast
only.Casts from isize
to i8
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i16(self) -> i16 ⓘ
cast
only.Casts from isize
to i16
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i32(self) -> i32 ⓘ
cast
only.Casts from isize
to i32
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i64(self) -> i64 ⓘ
cast
only.Casts from isize
to i64
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_i128(self) -> i128 ⓘ
cast
only.Casts from isize
to i128
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize(self) -> isize ⓘ
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize(self) -> isize ⓘ
cast
only.Casts from isize
to isize
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_up(self) -> isize_up
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_up(self) -> isize_up
cast
only.Casts from isize
to isize_up
wrapping at the numeric bounds.
Sourcepub const fn wrapping_cast_to_isize_down(self) -> isize_down
Available on crate feature cast
only.
pub const fn wrapping_cast_to_isize_down(self) -> isize_down
cast
only.Casts from isize
to isize_down
wrapping at the numeric bounds.
Source§impl Cast<u16>
impl Cast<u16>
Sourcepub const fn from_u8_be(v: [u8; 2]) -> u16 ⓘ
Available on crate feature join
only.
pub const fn from_u8_be(v: [u8; 2]) -> u16 ⓘ
join
only.Constructs a u16
from an array of [u8; 2]
in big-endian order.
Source§impl Cast<u32>
impl Cast<u32>
Sourcepub const fn from_u16_be(v: [u16; 2]) -> u32 ⓘ
Available on crate feature join
only.
pub const fn from_u16_be(v: [u16; 2]) -> u32 ⓘ
join
only.Constructs a u32
from an array of [u16; 2]
in big-endian order.
Sourcepub const fn from_u16_le(v: [u16; 2]) -> u32 ⓘ
Available on crate feature join
only.
pub const fn from_u16_le(v: [u16; 2]) -> u32 ⓘ
join
only.Constructs a u32
from an array of [u16; 2]
in little-endian order.
Sourcepub const fn from_u16_ne(v: [u16; 2]) -> u32 ⓘ
Available on crate feature join
only.
pub const fn from_u16_ne(v: [u16; 2]) -> u32 ⓘ
join
only.Constructs a u32
from an array of [u16; 2]
in native-endian order.
Sourcepub const fn from_u8_be(v: [u8; 4]) -> u32 ⓘ
Available on crate feature join
only.
pub const fn from_u8_be(v: [u8; 4]) -> u32 ⓘ
join
only.Constructs a u32
from an array of [u8; 4]
in big-endian order.
Source§impl Cast<u64>
impl Cast<u64>
Sourcepub const fn from_u32_be(v: [u32; 2]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u32_be(v: [u32; 2]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u32; 2]
in big-endian order.
Sourcepub const fn from_u32_le(v: [u32; 2]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u32_le(v: [u32; 2]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u32; 2]
in little-endian order.
Sourcepub const fn from_u32_ne(v: [u32; 2]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u32_ne(v: [u32; 2]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u32; 2]
in native-endian order.
Sourcepub const fn from_u16_be(v: [u16; 4]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u16_be(v: [u16; 4]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u16; 4]
in big-endian order.
Sourcepub const fn from_u16_le(v: [u16; 4]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u16_le(v: [u16; 4]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u16; 4]
in little-endian order.
Sourcepub const fn from_u16_ne(v: [u16; 4]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u16_ne(v: [u16; 4]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u16; 4]
in native-endian order.
Sourcepub const fn from_u8_be(v: [u8; 8]) -> u64 ⓘ
Available on crate feature join
only.
pub const fn from_u8_be(v: [u8; 8]) -> u64 ⓘ
join
only.Constructs a u64
from an array of [u8; 8]
in big-endian order.
Source§impl Cast<u128>
impl Cast<u128>
Sourcepub const fn from_u64_be(v: [u64; 2]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u64_be(v: [u64; 2]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u64; 2]
in big-endian order.
Sourcepub const fn from_u64_le(v: [u64; 2]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u64_le(v: [u64; 2]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u64; 2]
in little-endian order.
Sourcepub const fn from_u64_ne(v: [u64; 2]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u64_ne(v: [u64; 2]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u64; 2]
in native-endian order.
Sourcepub const fn from_u32_be(v: [u32; 4]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u32_be(v: [u32; 4]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u32; 4]
in big-endian order.
Sourcepub const fn from_u32_le(v: [u32; 4]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u32_le(v: [u32; 4]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u32; 4]
in little-endian order.
Sourcepub const fn from_u32_ne(v: [u32; 4]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u32_ne(v: [u32; 4]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u32; 4]
in native-endian order.
Sourcepub const fn from_u16_be(v: [u16; 8]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u16_be(v: [u16; 8]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u16; 8]
in big-endian order.
Sourcepub const fn from_u16_le(v: [u16; 8]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u16_le(v: [u16; 8]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u16; 8]
in little-endian order.
Sourcepub const fn from_u16_ne(v: [u16; 8]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u16_ne(v: [u16; 8]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u16; 8]
in native-endian order.
Sourcepub const fn from_u8_be(v: [u8; 16]) -> u128 ⓘ
Available on crate feature join
only.
pub const fn from_u8_be(v: [u8; 16]) -> u128 ⓘ
join
only.Constructs a u128
from an array of [u8; 16]
in big-endian order.
Source§impl Cast<u16>
impl Cast<u16>
Sourcepub const fn into_u8_be(self) -> [u8; 2]
Available on crate feature split
only.
pub const fn into_u8_be(self) -> [u8; 2]
split
only.Splits a u16
into an array of [u8; 2]
in big-endian order.
Sourcepub const fn into_u8_le(self) -> [u8; 2]
Available on crate feature split
only.
pub const fn into_u8_le(self) -> [u8; 2]
split
only.Splits a u16
into an array of [u8; 2]
in little-endian order.
Sourcepub const fn into_u8_ne(self) -> [u8; 2]
Available on crate feature split
only.
pub const fn into_u8_ne(self) -> [u8; 2]
split
only.Splits a u16
into an array of [u8; 2]
in native-endian order.
Source§impl Cast<u32>
impl Cast<u32>
Sourcepub const fn into_u16_be(self) -> [u16; 2]
Available on crate feature split
only.
pub const fn into_u16_be(self) -> [u16; 2]
split
only.Splits a u32
into an array of [u16; 2]
in big-endian order.
Sourcepub const fn into_u16_le(self) -> [u16; 2]
Available on crate feature split
only.
pub const fn into_u16_le(self) -> [u16; 2]
split
only.Splits a u32
into an array of [u16; 2]
in little-endian order.
Sourcepub const fn into_u16_ne(self) -> [u16; 2]
Available on crate feature split
only.
pub const fn into_u16_ne(self) -> [u16; 2]
split
only.Splits a u32
into an array of [u16; 2]
in native-endian order.
Sourcepub const fn into_u8_be(self) -> [u8; 4]
Available on crate feature split
only.
pub const fn into_u8_be(self) -> [u8; 4]
split
only.Splits a u32
into an array of [u8; 4]
in big-endian order.
Sourcepub const fn into_u8_le(self) -> [u8; 4]
Available on crate feature split
only.
pub const fn into_u8_le(self) -> [u8; 4]
split
only.Splits a u32
into an array of [u8; 4]
in little-endian order.
Sourcepub const fn into_u8_ne(self) -> [u8; 4]
Available on crate feature split
only.
pub const fn into_u8_ne(self) -> [u8; 4]
split
only.Splits a u32
into an array of [u8; 4]
in native-endian order.
Source§impl Cast<u64>
impl Cast<u64>
Sourcepub const fn into_u32_be(self) -> [u32; 2]
Available on crate feature split
only.
pub const fn into_u32_be(self) -> [u32; 2]
split
only.Splits a u64
into an array of [u32; 2]
in big-endian order.
Sourcepub const fn into_u32_le(self) -> [u32; 2]
Available on crate feature split
only.
pub const fn into_u32_le(self) -> [u32; 2]
split
only.Splits a u64
into an array of [u32; 2]
in little-endian order.
Sourcepub const fn into_u32_ne(self) -> [u32; 2]
Available on crate feature split
only.
pub const fn into_u32_ne(self) -> [u32; 2]
split
only.Splits a u64
into an array of [u32; 2]
in native-endian order.
Sourcepub const fn into_u16_be(self) -> [u16; 4]
Available on crate feature split
only.
pub const fn into_u16_be(self) -> [u16; 4]
split
only.Splits a u64
into an array of [u16; 4]
in big-endian order.
Sourcepub const fn into_u16_le(self) -> [u16; 4]
Available on crate feature split
only.
pub const fn into_u16_le(self) -> [u16; 4]
split
only.Splits a u64
into an array of [u16; 4]
in little-endian order.
Sourcepub const fn into_u16_ne(self) -> [u16; 4]
Available on crate feature split
only.
pub const fn into_u16_ne(self) -> [u16; 4]
split
only.Splits a u64
into an array of [u16; 4]
in native-endian order.
Sourcepub const fn into_u8_be(self) -> [u8; 8]
Available on crate feature split
only.
pub const fn into_u8_be(self) -> [u8; 8]
split
only.Splits a u64
into an array of [u8; 8]
in big-endian order.
Sourcepub const fn into_u8_le(self) -> [u8; 8]
Available on crate feature split
only.
pub const fn into_u8_le(self) -> [u8; 8]
split
only.Splits a u64
into an array of [u8; 8]
in little-endian order.
Sourcepub const fn into_u8_ne(self) -> [u8; 8]
Available on crate feature split
only.
pub const fn into_u8_ne(self) -> [u8; 8]
split
only.Splits a u64
into an array of [u8; 8]
in native-endian order.
Source§impl Cast<u128>
impl Cast<u128>
Sourcepub const fn into_u64_be(self) -> [u64; 2]
Available on crate feature split
only.
pub const fn into_u64_be(self) -> [u64; 2]
split
only.Splits a u128
into an array of [u64; 2]
in big-endian order.
Sourcepub const fn into_u64_le(self) -> [u64; 2]
Available on crate feature split
only.
pub const fn into_u64_le(self) -> [u64; 2]
split
only.Splits a u128
into an array of [u64; 2]
in little-endian order.
Sourcepub const fn into_u64_ne(self) -> [u64; 2]
Available on crate feature split
only.
pub const fn into_u64_ne(self) -> [u64; 2]
split
only.Splits a u128
into an array of [u64; 2]
in native-endian order.
Sourcepub const fn into_u32_be(self) -> [u32; 4]
Available on crate feature split
only.
pub const fn into_u32_be(self) -> [u32; 4]
split
only.Splits a u128
into an array of [u32; 4]
in big-endian order.
Sourcepub const fn into_u32_le(self) -> [u32; 4]
Available on crate feature split
only.
pub const fn into_u32_le(self) -> [u32; 4]
split
only.Splits a u128
into an array of [u32; 4]
in little-endian order.
Sourcepub const fn into_u32_ne(self) -> [u32; 4]
Available on crate feature split
only.
pub const fn into_u32_ne(self) -> [u32; 4]
split
only.Splits a u128
into an array of [u32; 4]
in native-endian order.
Sourcepub const fn into_u16_be(self) -> [u16; 8]
Available on crate feature split
only.
pub const fn into_u16_be(self) -> [u16; 8]
split
only.Splits a u128
into an array of [u16; 8]
in big-endian order.
Sourcepub const fn into_u16_le(self) -> [u16; 8]
Available on crate feature split
only.
pub const fn into_u16_le(self) -> [u16; 8]
split
only.Splits a u128
into an array of [u16; 8]
in little-endian order.
Sourcepub const fn into_u16_ne(self) -> [u16; 8]
Available on crate feature split
only.
pub const fn into_u16_ne(self) -> [u16; 8]
split
only.Splits a u128
into an array of [u16; 8]
in native-endian order.
Sourcepub const fn into_u8_be(self) -> [u8; 16]
Available on crate feature split
only.
pub const fn into_u8_be(self) -> [u8; 16]
split
only.Splits a u128
into an array of [u8; 16]
in big-endian order.
Sourcepub const fn into_u8_le(self) -> [u8; 16]
Available on crate feature split
only.
pub const fn into_u8_le(self) -> [u8; 16]
split
only.Splits a u128
into an array of [u8; 16]
in little-endian order.
Sourcepub const fn into_u8_ne(self) -> [u8; 16]
Available on crate feature split
only.
pub const fn into_u8_ne(self) -> [u8; 16]
split
only.Splits a u128
into an array of [u8; 16]
in native-endian order.
Trait Implementations§
Source§impl<T: ConstDefault> ConstDefault for Cast<T>
impl<T: ConstDefault> ConstDefault for Cast<T>
Source§impl<T: Ord> Ord for Cast<T>
impl<T: Ord> Ord for Cast<T>
Source§impl<T: PartialOrd> PartialOrd for Cast<T>
impl<T: PartialOrd> PartialOrd for Cast<T>
impl<T: Copy> Copy for Cast<T>
impl<T: Eq> Eq for Cast<T>
Auto Trait Implementations§
impl<T> Freeze for Cast<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cast<T>where
T: RefUnwindSafe,
impl<T> Send for Cast<T>where
T: Send,
impl<T> Sync for Cast<T>where
T: Sync,
impl<T> Unpin for Cast<T>where
T: Unpin,
impl<T> UnwindSafe for Cast<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.