Struct bigwise::Bw64
[−]
[src]
pub struct Bw64(_);
A Bigwise
type composed of 64 bits.
Wraps a u64
Trait Implementations
impl Copy for Bw64
[src]
impl Clone for Bw64
[src]
fn clone(&self) -> Bw64
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Bw64
[src]
impl PartialEq for Bw64
[src]
fn eq(&self, __arg_0: &Bw64) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Bw64) -> bool
This method tests for !=
.
impl Hash for Bw64
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Bw64
[src]
impl Ord for Bw64
[src]
fn cmp(&self, __arg_0: &Bw64) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialOrd for Bw64
[src]
fn partial_cmp(&self, __arg_0: &Bw64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Bw64) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Bw64) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Bw64) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Bw64) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Bigwise for Bw64
[src]
fn size() -> u32
Number of bits stored.
fn empty() -> Self
A value with all bits set to 0.
fn full() -> Self
A value with all bits set to 1.
fn from_bytes(bytes: &[u8]) -> Self
Creates a value based on raw data. Read more
fn to_bytes(self) -> Vec<u8>
The content of the value as raw bytes. Read more
fn get(self, i: u32) -> bool
The boolean value of the given bit. Read more
fn set(&mut self, i: u32, v: bool)
Assigns a boolean value to a given bit. Read more
fn rotate_left(self, n: u32) -> Self
Rotates all the bits n
positions to the left. Read more
fn rotate_right(self, n: u32) -> Self
Rotates all the bits n
positions to the right. Read more
impl Rand for Bw64
[src]
fn rand<R: Rng>(rng: &mut R) -> Self
Generates a random instance of this type using the specified source of randomness. Read more
impl Debug for Bw64
[src]
The sequence of zeroes and ones, the MSB (most significant bit) appearing on the left.
impl BitAnd for Bw64
[src]
type Output = Self
The resulting type after applying the &
operator
fn bitand(self, rhs: Self) -> Self
The method for the &
operator
impl BitOr for Bw64
[src]
type Output = Self
The resulting type after applying the |
operator
fn bitor(self, rhs: Self) -> Self
The method for the |
operator
impl BitXor for Bw64
[src]
type Output = Self
The resulting type after applying the ^
operator
fn bitxor(self, rhs: Self) -> Self
The method for the ^
operator
impl Not for Bw64
[src]
type Output = Self
The resulting type after applying the !
operator
fn not(self) -> Self
The method for the unary !
operator
impl Shl<u32> for Bw64
[src]
type Output = Self
The resulting type after applying the <<
operator
fn shl(self, rhs: u32) -> Self
The method for the <<
operator
impl Shr<u32> for Bw64
[src]
type Output = Self
The resulting type after applying the >>
operator
fn shr(self, rhs: u32) -> Self
The method for the >>
operator
impl IntoIterator for Bw64
[src]
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));