Struct bitpack::BitPack [] [src]

pub struct BitPack<B> { /* fields omitted */ }

Methods

impl<B> BitPack<B>
[src]

impl<B: AsRef<[u8]>> BitPack<B>
[src]

impl<'a> BitPack<&'a mut [u8]>
[src]

use bitpack::BitPack;

let mut buff = [0; 2];

{
    let mut bitpack = BitPack::<&mut [u8]>::new(&mut buff);
    bitpack.write(10, 4).unwrap();
    bitpack.write(1021, 10).unwrap();
    bitpack.write(3, 2).unwrap();
}

assert_eq!(buff, [218, 255]);

impl<'a> BitPack<&'a [u8]>
[src]

use bitpack::BitPack;

let mut buff = [218, 255];

let mut bitpack = BitPack::<&[u8]>::new(&buff);
assert_eq!(bitpack.read(4).unwrap(), 10);
assert_eq!(bitpack.read(10).unwrap(), 1021);
assert_eq!(bitpack.read(2).unwrap(), 3);

Trait Implementations

impl<B: Clone> Clone for BitPack<B>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<B: Debug> Debug for BitPack<B>
[src]

Formats the value using the given formatter.

impl<B: PartialEq> PartialEq for BitPack<B>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<B: Eq> Eq for BitPack<B>
[src]