Shift

Trait Shift 

Source
pub trait Shift:
    Copy
    + Shl<usize, Output = Self>
    + Shr<usize, Output = Self> {
    // Required method
    fn shs(self, f: i8) -> Self;
}
Expand description

Shift summary trait

Wrapping supports Sh{lr}<usize> only.

Required Methods§

Source

fn shs(self, f: i8) -> Self

Signed shift (positive: left)

x*2**f

assert_eq!(1i32.shs(1), 2);
assert_eq!(4i32.shs(-1), 2);

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.

Implementors§

Source§

impl<T: Copy + Shl<usize, Output = T> + Shr<usize, Output = T>> Shift for T