Skip to main content

ConstCheckedShr

Trait ConstCheckedShr 

Source
pub trait ConstCheckedShr: Sized + ConstOverflowingShr {
    // Required method
    fn checked_shr(&self, rhs: u32) -> Option<Self>;
}
Expand description

Const-compatible checked right shift.

Required Methods§

Source

fn checked_shr(&self, rhs: u32) -> Option<Self>

Checked shift right. Returns None if the shift amount exceeds bit width.

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 ConstCheckedShr for u8

Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Source§

impl ConstCheckedShr for u16

Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Source§

impl ConstCheckedShr for u32

Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Source§

impl ConstCheckedShr for u64

Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Source§

impl ConstCheckedShr for u128

Source§

fn checked_shr(&self, rhs: u32) -> Option<Self>

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstCheckedShr for FixedUInt<T, N>