Split

Trait Split 

Source
pub trait Split: Sized {
    type Hi;
    type Lo;

    // Required methods
    fn hi(self) -> Self::Hi;
    fn lo(self) -> Self::Lo;
    fn lo_hi(self) -> (Self::Lo, Self::Hi);
}
Expand description

Splits an integer into it’s low and high part

Required Associated Types§

Source

type Hi

Output type for higher part

Source

type Lo

Output type for lower part

Required Methods§

Source

fn hi(self) -> Self::Hi

Returns the high part of this integer

Source

fn lo(self) -> Self::Lo

Returns the low part of this integer

Source

fn lo_hi(self) -> (Self::Lo, Self::Hi)

Returns the low and high part of this integer

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 Split for u16

Source§

type Hi = u8

Source§

type Lo = u8

Source§

fn lo(self) -> Self::Lo

Source§

fn hi(self) -> Self::Hi

Source§

fn lo_hi(self) -> (Self::Lo, Self::Hi)

Source§

impl Split for u32

Source§

type Hi = u16

Source§

type Lo = u16

Source§

fn lo(self) -> Self::Lo

Source§

fn hi(self) -> Self::Hi

Source§

fn lo_hi(self) -> (Self::Lo, Self::Hi)

Source§

impl Split for u64

Source§

type Hi = u32

Source§

type Lo = u32

Source§

fn lo(self) -> Self::Lo

Source§

fn hi(self) -> Self::Hi

Source§

fn lo_hi(self) -> (Self::Lo, Self::Hi)

Source§

impl Split for u128

Source§

type Hi = u64

Source§

type Lo = u64

Source§

fn lo(self) -> Self::Lo

Source§

fn hi(self) -> Self::Hi

Source§

fn lo_hi(self) -> (Self::Lo, Self::Hi)

Implementors§