Trait stable_id::CastUsize

source ·
pub trait CastUsize {
    // Required methods
    fn cast_to(self) -> usize;
    fn cast_from(val: usize) -> Self;
}
Expand description

Trait for casting between an unsigned integer to a usize, and vice versa. Note: to() would panic if the value is greater or equal to the type’s max.

Required Methods§

source

fn cast_to(self) -> usize

Turning an unsigned integer into a usize.

source

fn cast_from(val: usize) -> Self

Turning a usize into an unsigned integer.

Implementations on Foreign Types§

source§

impl CastUsize for usize

source§

impl CastUsize for u8

source§

impl CastUsize for u64

source§

impl CastUsize for u32

source§

impl CastUsize for u16

Implementors§