pub trait ConstUnboundedShift: Sized {
// Required methods
fn unbounded_shl(self, rhs: u32) -> Self;
fn unbounded_shr(self, rhs: u32) -> Self;
}Expand description
Const-compatible unbounded shift operations.
Unlike regular shifts, unbounded shifts don’t panic when the shift amount exceeds the bit width. Instead:
unbounded_shl(n)returns 0 when n >= BITS (all bits shifted out)unbounded_shr(n)returns 0 when n >= BITS (all bits shifted out)
Required Methods§
Sourcefn unbounded_shl(self, rhs: u32) -> Self
fn unbounded_shl(self, rhs: u32) -> Self
Unbounded shift left. Returns 0 if rhs is greater than or equal to the bit width of the type.
Sourcefn unbounded_shr(self, rhs: u32) -> Self
fn unbounded_shr(self, rhs: u32) -> Self
Unbounded shift right. Returns 0 if rhs is greater than or equal to the bit width of the type.
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.