pub trait ScalarBitSetStorage:
Default
+ From<u8>
+ Shl<u8, Output = Self>
+ Shr<u8, Output = Self>
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ Not<Output = Self>
+ Sub<Output = Self>
+ Add<Output = Self>
+ PartialEq
+ Copy {
// Required methods
fn leading_zeros(self) -> u8;
fn trailing_zeros(self) -> u8;
fn count_ones(self) -> u8;
}
Expand description
A trait implemented by all integers that can be used as the backing storage
for a ScalarBitSet
.
You shouldn’t have to implement this yourself, it is already implemented for
u{8,16,32,64,128}
and if you need more bits than that, then use
CompoundBitSet
instead.
Required Methods§
Sourcefn leading_zeros(self) -> u8
fn leading_zeros(self) -> u8
Count the number of leading zeros.
Sourcefn trailing_zeros(self) -> u8
fn trailing_zeros(self) -> u8
Count the number of trailing zeros.
Sourcefn count_ones(self) -> u8
fn count_ones(self) -> u8
Count the number of bits set in this integer.
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.