Skip to main content

UnboundedShl

Trait UnboundedShl 

Source
pub trait UnboundedShl: Sized {
    type Output;

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

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

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

fn unbounded_shl(self, rhs: u32) -> Self::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§

type Output = i8

Source§

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

Source§

impl UnboundedShl for i16

Source§

type Output = i16

Source§

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

Source§

impl UnboundedShl for i32

Source§

type Output = i32

Source§

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

Source§

impl UnboundedShl for i64

Source§

type Output = i64

Source§

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

Source§

impl UnboundedShl for i128

Source§

type Output = i128

Source§

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

Source§

impl UnboundedShl for isize

Source§

type Output = isize

Source§

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

Source§

impl UnboundedShl for u8

Source§

type Output = u8

Source§

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

Source§

impl UnboundedShl for u16

Source§

type Output = u16

Source§

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

Source§

impl UnboundedShl for u32

Source§

type Output = u32

Source§

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

Source§

impl UnboundedShl for u64

Source§

type Output = u64

Source§

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

Source§

impl UnboundedShl for u128

Source§

type Output = u128

Source§

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

Source§

impl UnboundedShl for usize

Source§

type Output = usize

Source§

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

Implementors§