pub struct Bw64(/* private fields */);
Expand description
A Bigwise
type composed of 64 bits.
Wraps a u64
Trait Implementations§
Source§impl Bigwise for Bw64
impl Bigwise for Bw64
Source§fn from_bytes(bytes: &[u8]) -> Self
fn from_bytes(bytes: &[u8]) -> Self
Creates a value based on raw data. Read more
Source§fn rotate_left(self, n: u32) -> Self
fn rotate_left(self, n: u32) -> Self
Rotates all the bits
n
positions to the left. Read moreSource§fn rotate_right(self, n: u32) -> Self
fn rotate_right(self, n: u32) -> Self
Rotates all the bits
n
positions to the right. Read moreSource§impl Debug for Bw64
The sequence of zeroes and ones, the MSB (most significant bit)
appearing on the left.
impl Debug for Bw64
The sequence of zeroes and ones, the MSB (most significant bit) appearing on the left.
Source§impl IntoIterator for Bw64
An iterator over the bits.
impl IntoIterator for Bw64
An iterator over the bits.
Bits are iterated from the least significant one to the most significant one.
§Examples
use bigwise::{Bigwise, Bw64};
let b = Bw64::from_bytes(&[0b11111000]);
let mut it = b.into_iter();
assert_eq!(Some(false), it.next());
assert_eq!(Some(false), it.next());
assert_eq!(Some(false), it.next());
assert_eq!(Some(true), it.next());
assert_eq!(Some(true), it.next());
assert_eq!(Some(true), it.next());
assert_eq!(Some(true), it.next());
assert_eq!(Some(true), it.next());
assert_eq!(Some(false), it.next());
assert_eq!(Some(false), it.next());
assert!(it.take(200).all(|v| v == false));
Source§impl Ord for Bw64
impl Ord for Bw64
Source§impl PartialOrd for Bw64
impl PartialOrd for Bw64
impl Copy for Bw64
impl Eq for Bw64
impl StructuralPartialEq for Bw64
Auto Trait Implementations§
impl Freeze for Bw64
impl RefUnwindSafe for Bw64
impl Send for Bw64
impl Sync for Bw64
impl Unpin for Bw64
impl UnwindSafe for Bw64
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