Crate num_conv

Crate num_conv 

Source
Expand description

num_conv is a crate to convert between integer types without using as casts. This provides better certainty when refactoring, makes the exact behavior of code more explicit, and allows using turbofish syntax.

Modulesยง

prelude
Anonymously import all extension traits.
sealed ๐Ÿ”’

Macrosยง

impl_cast_signed ๐Ÿ”’
impl_cast_unsigned ๐Ÿ”’
impl_extend ๐Ÿ”’
impl_truncate ๐Ÿ”’

Traitsยง

CastSigned
Cast to a signed integer of the same size.
CastUnsigned
Cast to an unsigned integer of the same size.
Extend
Extend to an integer of the same size or larger, preserving its value.
ExtendTarget
A type that can be used with turbofish syntax in Extend::extend.
Truncate
Truncate to an integer of the same size or smaller, preserving the least significant bits.
TruncateTarget
A type that can be used with turbofish syntax in Truncate::truncate.