[][src]Trait tag_vec::BitField

pub trait BitField: BitAnd<Output = Self> + BitOr<Output = Self> + Not<Output = Self> + Sized + Copy {
    fn empty() -> Self;
fn set_bit(&mut self, n: usize, state: bool);
fn get_bit(&self, n: usize) -> bool;
fn n_bits() -> usize; }

A trait for a type that can work as a bitfield.

Required methods

fn empty() -> Self

Creates a bitfield with no bits set

fn set_bit(&mut self, n: usize, state: bool)

Sets a bit. Assumes that n is less than n_bits

fn get_bit(&self, n: usize) -> bool

Gets a bit. Assumes that n is less than n_bits

fn n_bits() -> usize

Returns the number of bits.

Loading content...

Implementations on Foreign Types

impl BitField for u8[src]

impl BitField for u16[src]

impl BitField for u32[src]

impl BitField for u64[src]

impl BitField for u128[src]

Loading content...

Implementors

Loading content...