Skip to main content

ToU64

Trait ToU64 

Source
pub trait ToU64: CastInto<Self::Output> {
    type Output;

    // Required methods
    fn to_u64(self) -> Self::Output;
    fn to_u64_range(self) -> Self::Output;
}
Expand description

Helper trait based on CastInto and CastRangeInto Also work on composite like std::array, Vector

Required Associated Types§

Required Methods§

Source

fn to_u64(self) -> Self::Output

Same semantics as the as keyword: 4f32 as u64, and the From trait, but generic friendly.

Like the as keyword, the result might lose some precision.

Source

fn to_u64_range(self) -> Self::Output

Remap the value RangeDefault to the RangeDefault of the target type, in a generic friendly way, and similar to the From trait.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ToU64 for bool

Source§

impl ToU64 for f32

Source§

impl ToU64 for f64

Source§

impl ToU64 for i8

Source§

impl ToU64 for i16

Source§

impl ToU64 for i32

Source§

impl ToU64 for i64

Source§

impl ToU64 for isize

Source§

impl ToU64 for u8

Source§

impl ToU64 for u16

Source§

impl ToU64 for u32

Source§

impl ToU64 for u64

Source§

impl ToU64 for usize

Implementors§

Source§

impl<S> ToU64 for S
where S: Map + CastInto<<S as Map>::WithType<<<S as MapIntern>::Item as ToU64>::Output>>, <S as MapIntern>::Item: ToU64,

Source§

type Output = <S as Map>::WithType<<<S as MapIntern>::Item as ToU64>::Output>