pub struct BitRef<'a, T: Bitset + 'a>(/* private fields */);Expand description
Smart pointer granting immutable access to a bit in Bitset.
Is not meant to be created manually, instead use methods defined on Bitset
to get a value of this type.
This type isn’t magic, it actually holds the Bit value.
§Examples
use bitworks::prelude::*;
let bitset = Bitset8::NONE.set(1.try_into()?).build();
assert_eq!(*bitset.bit_ref(0.try_into()?), Zero);
assert_eq!(*bitset.bit_ref(1.try_into()?), One);Implementations§
Trait Implementations§
source§impl<'a, T: PartialEq + Bitset + 'a> PartialEq for BitRef<'a, T>
impl<'a, T: PartialEq + Bitset + 'a> PartialEq for BitRef<'a, T>
impl<'a, T> Copy for BitRef<'a, T>where
T: Bitset + 'a,
impl<'a, T: Eq + Bitset + 'a> Eq for BitRef<'a, T>
impl<'a, T: Bitset + 'a> StructuralPartialEq for BitRef<'a, T>
Auto Trait Implementations§
impl<'a, T> RefUnwindSafe for BitRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for BitRef<'a, T>
impl<'a, T> Sync for BitRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for BitRef<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for BitRef<'a, T>where
T: UnwindSafe + RefUnwindSafe,
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