Skip to main content

FunnelShl

Trait FunnelShl 

Source
pub trait FunnelShl: Sized {
    type Output;

    // Required method
    fn funnel_shl(self, rhs: Self, n: u32) -> Self::Output;
}
Expand description

Performs a funnel left shift on a double-width value formed from two words.

Required Associated Types§

Source

type Output

Funnel shift left: concatenates self (high word) with rhs (low word), shifts the combination left by n, and returns the high word — i.e. (self << n) | (rhs >> (BITS - n)). Like std, this is only provided for unsigned types.

§Panics

Panics if n >= BITS.

use const_num_traits::FunnelShl;

assert_eq!(FunnelShl::funnel_shl(0x01u8, 0x80, 1), 0x03);

Required Methods§

Source

fn funnel_shl(self, rhs: Self, n: u32) -> Self::Output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FunnelShl for u8

Source§

type Output = u8

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Source§

impl FunnelShl for u16

Source§

type Output = u16

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Source§

impl FunnelShl for u32

Source§

type Output = u32

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Source§

impl FunnelShl for u64

Source§

type Output = u64

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Source§

impl FunnelShl for u128

Source§

type Output = u128

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Source§

impl FunnelShl for usize

Source§

type Output = usize

Source§

fn funnel_shl(self, rhs: Self, n: u32) -> Self

Implementors§