pub struct BitIdx(pub u8);Tuple Fields§
§0: u8Implementations§
Source§impl BitIdx
impl BitIdx
Sourcepub fn of_single_set_bit(x: u32) -> Option<Self>
pub fn of_single_set_bit(x: u32) -> Option<Self>
Returns Some(BitIdx(i)) if and only if x == (1 << i).
Sourcepub fn of_all_set_bits(x: u32) -> impl Iterator<Item = Self>
pub fn of_all_set_bits(x: u32) -> impl Iterator<Item = Self>
Returns an iterator of BitIdxs, from which x can be reconstructed
by OR-ing together 1 << i for every BitIdx(i).
The iterator is ordered: lower bit indices appear before higher ones.
Trait Implementations§
impl Copy for BitIdx
impl Eq for BitIdx
impl StructuralPartialEq for BitIdx
Auto Trait Implementations§
impl Freeze for BitIdx
impl RefUnwindSafe for BitIdx
impl Send for BitIdx
impl Sync for BitIdx
impl Unpin for BitIdx
impl UnwindSafe for BitIdx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more