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§
Sourcefn unbounded_shl(self, rhs: u32) -> <Self as Shl<u32>>::Output
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".