Trait sapio_bitcoin::util::BitArray[][src]

pub trait BitArray {
    fn bit(&self, idx: usize) -> bool;
fn bit_slice(&self, start: usize, end: usize) -> Self;
fn mask(&self, n: usize) -> Self;
fn trailing_zeros(&self) -> usize;
fn zero() -> Self;
fn one() -> Self; }

A trait which allows numbers to act as fixed-size bit arrays

Required methods

fn bit(&self, idx: usize) -> bool[src]

Is bit set?

fn bit_slice(&self, start: usize, end: usize) -> Self[src]

Returns an array which is just the bits from start to end

fn mask(&self, n: usize) -> Self[src]

Bitwise and with n ones

fn trailing_zeros(&self) -> usize[src]

Trailing zeros

fn zero() -> Self[src]

Create all-zeros value

fn one() -> Self[src]

Create value representing one

Loading content...

Implementors

impl BitArray for Uint128[src]

impl BitArray for Uint256[src]

Loading content...