Trait checked_int_cast::CheckedIntCast [] [src]

pub trait CheckedIntCast {
    fn as_isize_checked(self) -> Option<isize>;
    fn as_i8_checked(self) -> Option<i8>;
    fn as_i16_checked(self) -> Option<i16>;
    fn as_i32_checked(self) -> Option<i32>;
    fn as_i64_checked(self) -> Option<i64>;
    fn as_usize_checked(self) -> Option<usize>;
    fn as_u8_checked(self) -> Option<u8>;
    fn as_u16_checked(self) -> Option<u16>;
    fn as_u32_checked(self) -> Option<u32>;
    fn as_u64_checked(self) -> Option<u64>;
}

This trait allows a value to be cast to the various primitive integer types. If the conversion overflows or underflows, the functions return None.

Required Methods

Implementors