Struct adapton::catalog::bitstring::BS
[−]
[src]
pub struct BS { pub length: i64, pub value: i64, }
Bit Strings are length/value pairs, so that bit strings with leading zeros aren't conflated.
Fields
length: i64
value: i64
Trait Implementations
impl Eq for BS
[src]
impl PartialEq for BS
[src]
fn eq(&self, __arg_0: &BS) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BS) -> bool
[src]
This method tests for !=
.
impl Hash for BS
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for BS
[src]
impl Clone for BS
[src]
fn clone(&self) -> BS
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for BS
[src]
impl BitString for BS
[src]
fn pow(b: i64, n: i64) -> i64
[src]
pow(b, n)
yields bn
fn flip(i: i64, b: i64) -> i64
[src]
flip(i, b)
toggles the i
th bit of b
.
fn is_set(i: i64, b: i64) -> bool
[src]
is_set(i, b)
returns true if the i
th bit of b
is set
fn prepend(b: i64, bs: BS) -> BS
[src]
prepend(b, bs)
prepends the bit b
onto the bitstring bs
.
b
must be either 0
or 1
.
fn length(bs: BS) -> i64
[src]
Returns the length of the bitstring bs
.
fn shift_left(bs: BS, i: i64) -> BS
[src]
Performs a logical shift left on the bitstring bs
.
const MAX_LEN: i64
MAX_LEN: i64 = 30
The maximum supported length of a bitstring is 30 bits.