[][src]Struct gf::support::bitvec::SmallBitVec

pub struct SmallBitVec { /* fields omitted */ }

Bit vector supporting up to 128 bits of data.

Methods

impl SmallBitVec[src]

pub const MAX_LEN: usize[src]

Maximum small bit vector length.

pub fn new() -> Self[src]

Create an empty small bit vector.

pub fn from_bits(bits: u128, bit_len: usize) -> Self[src]

Create a small bit vector from bits and length.

Errors

  • Panics if length exceeds 128.

pub fn is_empty(&self) -> bool[src]

Return whether the vector is empty.

pub fn len(&self) -> usize[src]

Return the vector length.

pub fn to_u128(&self) -> u128[src]

Return the raw bits zero-extended to u128.

pub fn to_i128(&self) -> i128[src]

Return the raw bits sign-extended to i128.

pub fn mask(&self) -> u128[src]

Return the mask to be applied to bits, consisting of len set LSB bits.

pub fn get(&self, bit_index: usize) -> bool[src]

Return bit value at bit_index.

Errors

  • Panics on out-of-bound indexing.

pub fn set(&mut self, bit_index: usize, value: bool)[src]

Set bit value at bit_index.

Errors

  • Panics on out-of-bound indexing.

pub fn apply_operator<'a, I>(
    operator: BitVecOperator,
    operands: I
) -> Result<Self, BitVecOperatorError> where
    I: IntoIterator<Item = &'a SmallBitVec>, 
[src]

Apply an operator to SmallBitVec operands.

Trait Implementations

impl BitSeq for SmallBitVec[src]

impl BitSeqMut for SmallBitVec[src]

impl Clone for SmallBitVec[src]

impl Copy for SmallBitVec[src]

impl Default for SmallBitVec[src]

impl Eq for SmallBitVec[src]

impl PartialEq<SmallBitVec> for SmallBitVec[src]

impl Debug for SmallBitVec[src]

impl Hash for SmallBitVec[src]

impl StructuralPartialEq for SmallBitVec[src]

impl StructuralEq for SmallBitVec[src]

Auto Trait Implementations

impl Send for SmallBitVec

impl Sync for SmallBitVec

impl Unpin for SmallBitVec

impl UnwindSafe for SmallBitVec

impl RefUnwindSafe for SmallBitVec

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]