Skip to main content

ConstCheckedShl

Trait ConstCheckedShl 

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

Const-compatible checked left shift.

Required Methods§

Source

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

Checked shift left. 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 ConstCheckedShl for u8

Source§

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

Source§

impl ConstCheckedShl for u16

Source§

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

Source§

impl ConstCheckedShl for u32

Source§

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

Source§

impl ConstCheckedShl for u64

Source§

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

Source§

impl ConstCheckedShl for u128

Source§

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

Implementors§

Source§

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