Skip to main content

FunnelShr

Trait FunnelShr 

Source
pub trait FunnelShr: Sized {
    type Output;

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

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

Required Associated Types§

Source

type Output

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

§Panics

Panics if n >= BITS.

use const_num_traits::FunnelShr;

assert_eq!(FunnelShr::funnel_shr(0x01u8, 0x80, 1), 0xC0);

Required Methods§

Source

fn funnel_shr(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 FunnelShr for u8

Source§

type Output = u8

Source§

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

Source§

impl FunnelShr for u16

Source§

type Output = u16

Source§

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

Source§

impl FunnelShr for u32

Source§

type Output = u32

Source§

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

Source§

impl FunnelShr for u64

Source§

type Output = u64

Source§

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

Source§

impl FunnelShr for u128

Source§

type Output = u128

Source§

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

Source§

impl FunnelShr for usize

Source§

type Output = usize

Source§

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

Implementors§