pub struct OneBitBool { /* private fields */ }Implementations§
Source§impl OneBitBool
impl OneBitBool
Sourcepub fn from(bool: bool) -> Self
pub fn from(bool: bool) -> Self
Create a new OneBitBool from a bool
§Examples
use bit_bool::OneBitBool;
let b = OneBitBool::from(true);Sourcepub fn empty() -> Self
pub fn empty() -> Self
Empty constructor
§Examples
use bit_bool::OneBitBool;
let b = OneBitBool::empty();
assert_eq!(b, OneBitBool::from(false));Sourcepub fn get_index(&self, index: usize) -> bool
pub fn get_index(&self, index: usize) -> bool
Gets the value of the bit at the given index
§Examples
use bit_bool::OneBitBool;
let b = OneBitBool::from(true);
assert_eq!(b.get_index(0), true);Sourcepub fn change_index(&mut self, index: usize, value: bool)
pub fn change_index(&mut self, index: usize, value: bool)
Changes the value of the bit at the given index
§Examples
use bit_bool::OneBitBool;
let mut b = OneBitBool::from(true);
b.change_index(0, false);Trait Implementations§
Source§impl Clone for OneBitBool
impl Clone for OneBitBool
Source§fn clone(&self) -> OneBitBool
fn clone(&self) -> OneBitBool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OneBitBool
impl Debug for OneBitBool
Source§impl Display for OneBitBool
A trait for displaying a OneBitBool
impl Display for OneBitBool
A trait for displaying a OneBitBool
§Examples
use bit_bool::OneBitBool;
let b = OneBitBool::from(true);
assert_eq!(format!("{}", b), "11111111");Source§impl PartialEq for OneBitBool
impl PartialEq for OneBitBool
impl Copy for OneBitBool
impl StructuralPartialEq for OneBitBool
Auto Trait Implementations§
impl Freeze for OneBitBool
impl RefUnwindSafe for OneBitBool
impl Send for OneBitBool
impl Sync for OneBitBool
impl Unpin for OneBitBool
impl UnwindSafe for OneBitBool
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