pub trait BinaryRepr<Size = u32>:
Sized
+ Not<Output = Self>
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ BitXor<Output = Self>
+ Shl<Size, Output = Self>
+ Shr<Size, Output = Self>
+ BitAndAssign
+ BitOrAssign
+ BitXorAssign
+ ShlAssign<Size>
+ ShrAssign<Size> {
// Required methods
fn count_ones(self) -> Size;
fn count_zeros(self) -> Size;
fn leading_ones(self) -> Size;
fn leading_zeros(self) -> Size;
fn reverse_bits(self) -> Self;
fn rotate_left(self, n: Size) -> Self;
fn rotate_right(self, n: Size) -> Self;
fn swap_bytes(self) -> Self;
fn trailing_ones(self) -> Size;
fn trailing_zeros(self) -> Size;
}
Expand description
Trait for operations of integer in binary representation.
Required Methods§
fn count_ones(self) -> Size
fn count_zeros(self) -> Size
fn leading_ones(self) -> Size
fn leading_zeros(self) -> Size
fn reverse_bits(self) -> Self
fn rotate_left(self, n: Size) -> Self
fn rotate_right(self, n: Size) -> Self
fn swap_bytes(self) -> Self
fn trailing_ones(self) -> Size
fn trailing_zeros(self) -> Size
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.