pub trait LowestOne: Sized {
// Required method
fn lowest_one(self) -> Option<u32>;
}Expand description
Finds the index of the lowest one-bit.
Required Methods§
Sourcefn lowest_one(self) -> Option<u32>
fn lowest_one(self) -> Option<u32>
Returns the index of the lowest bit set to one, or None if the
value is zero.
use const_num_traits::LowestOne;
assert_eq!(LowestOne::lowest_one(0b0101_0000u8), Some(4));
assert_eq!(LowestOne::lowest_one(0u8), None);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".