Module cast

Source
Expand description

Cast utilities.

Re-exports§

pub use target64::*;

Modules§

target64
Safe casts for 64bit platforms

Macros§

cast_from 🔒
cast_lossy 🔒
Implement CastLossy for the specified types.
reinterpret_cast 🔒
try_cast_from 🔒
Implement TryCastFrom for the specified types. This is only necessary for types for which as exists, but TryFrom doesn’t (notably floats).

Traits§

CastFrom
A trait for safe, simple, and infallible casts.
CastInto
The inverse of CastFrom. Implemented automatically, just like std::convert::Into.
CastLossy
A trait for potentially-lossy casts. Typically useful when converting from integers to floating point, and you want the nearest floating-point number to your integer when your integer is large, or vice versa.
ReinterpretCast
A trait for reinterpreting casts.
TryCastFrom
A trait for attempted casts.

Functions§

i8_to_i8
Casts [$from] to [$to].
i8_to_i16
Casts [$from] to [$to].
i8_to_i32
Casts [$from] to [$to].
i8_to_i64
Casts [$from] to [$to].
i8_to_i128
Casts [$from] to [$to].
i16_to_i16
Casts [$from] to [$to].
i16_to_i32
Casts [$from] to [$to].
i16_to_i64
Casts [$from] to [$to].
i16_to_i128
Casts [$from] to [$to].
i32_to_i32
Casts [$from] to [$to].
i32_to_i64
Casts [$from] to [$to].
i32_to_i128
Casts [$from] to [$to].
i64_to_i64
Casts [$from] to [$to].
i64_to_i128
Casts [$from] to [$to].
u8_to_i16
Casts [$from] to [$to].
u8_to_i32
Casts [$from] to [$to].
u8_to_i64
Casts [$from] to [$to].
u8_to_i128
Casts [$from] to [$to].
u8_to_u8
Casts [$from] to [$to].
u8_to_u16
Casts [$from] to [$to].
u8_to_u32
Casts [$from] to [$to].
u8_to_u64
Casts [$from] to [$to].
u8_to_u128
Casts [$from] to [$to].
u16_to_i32
Casts [$from] to [$to].
u16_to_i64
Casts [$from] to [$to].
u16_to_i128
Casts [$from] to [$to].
u16_to_u16
Casts [$from] to [$to].
u16_to_u32
Casts [$from] to [$to].
u16_to_u64
Casts [$from] to [$to].
u16_to_u128
Casts [$from] to [$to].
u32_to_i64
Casts [$from] to [$to].
u32_to_i128
Casts [$from] to [$to].
u32_to_u32
Casts [$from] to [$to].
u32_to_u64
Casts [$from] to [$to].
u32_to_u128
Casts [$from] to [$to].
u64_to_i128
Casts [$from] to [$to].
u64_to_u64
Casts [$from] to [$to].
u64_to_u128
Casts [$from] to [$to].