Skip to main content

UnboundedShl

Trait UnboundedShl 

Source
pub trait UnboundedShl: Sized + Shl<u32> {
    // Required method
    fn unbounded_shl(self, rhs: u32) -> <Self as Shl<u32>>::Output;
}
Expand description

Performs a left shift that never panics, returning 0 for large shifts.

Required Methods§

Source

fn unbounded_shl(self, rhs: u32) -> <Self as Shl<u32>>::Output

Unbounded shift left. Computes self << rhs, without bounding the value of rhs: if rhs >= BITS the entire value is shifted out and 0 is returned.

use const_num_traits::UnboundedShl;

assert_eq!(UnboundedShl::unbounded_shl(1u8, 4), 16);
assert_eq!(UnboundedShl::unbounded_shl(1u8, 200), 0);

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 UnboundedShl for i8

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for i16

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for i32

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for i64

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for i128

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for isize

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for u8

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for u16

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for u32

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for u64

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for u128

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Source§

impl UnboundedShl for usize

Source§

fn unbounded_shl(self, rhs: u32) -> Self

Implementors§