[][src]Trait bitvec::bits::Bits

pub trait Bits {
    type Store: BitStore;
    fn as_bitslice<C>(&self) -> &BitSlice<C, Self::Store>
    where
        C: Cursor
; }

Allows a type to be used as a sequence of immutable bits.

Requirements

This trait can only be implemented by contiguous structures: individual fundamentals, and sequences (arrays or slices) of them.

Associated Types

type Store: BitStore

The underlying fundamental type of the implementor.

Loading content...

Required methods

fn as_bitslice<C>(&self) -> &BitSlice<C, Self::Store> where
    C: Cursor

Constructs a BitSlice reference over data.

Type Parameters

  • C: Cursor: The Cursor type used to index within the slice.

Parameters

  • &self

Returns

A BitSlice handle over self’s data, using the provided Cursor type and using Self::Store as the data type.

Examples

use bitvec::prelude::*;

let src = 8u8;
let bits = src.as_bitslice::<BigEndian>();
assert!(bits[4]);
Loading content...

Implementations on Foreign Types

impl Bits for u8[src]

type Store = u8

impl Bits for [u8][src]

type Store = u8

impl Bits for [u8; 0][src]

type Store = u8

impl Bits for [u8; 1][src]

type Store = u8

impl Bits for [u8; 2][src]

type Store = u8

impl Bits for [u8; 3][src]

type Store = u8

impl Bits for [u8; 4][src]

type Store = u8

impl Bits for [u8; 5][src]

type Store = u8

impl Bits for [u8; 6][src]

type Store = u8

impl Bits for [u8; 7][src]

type Store = u8

impl Bits for [u8; 8][src]

type Store = u8

impl Bits for [u8; 9][src]

type Store = u8

impl Bits for [u8; 10][src]

type Store = u8

impl Bits for [u8; 11][src]

type Store = u8

impl Bits for [u8; 12][src]

type Store = u8

impl Bits for [u8; 13][src]

type Store = u8

impl Bits for [u8; 14][src]

type Store = u8

impl Bits for [u8; 15][src]

type Store = u8

impl Bits for [u8; 16][src]

type Store = u8

impl Bits for [u8; 17][src]

type Store = u8

impl Bits for [u8; 18][src]

type Store = u8

impl Bits for [u8; 19][src]

type Store = u8

impl Bits for [u8; 20][src]

type Store = u8

impl Bits for [u8; 21][src]

type Store = u8

impl Bits for [u8; 22][src]

type Store = u8

impl Bits for [u8; 23][src]

type Store = u8

impl Bits for [u8; 24][src]

type Store = u8

impl Bits for [u8; 25][src]

type Store = u8

impl Bits for [u8; 26][src]

type Store = u8

impl Bits for [u8; 27][src]

type Store = u8

impl Bits for [u8; 28][src]

type Store = u8

impl Bits for [u8; 29][src]

type Store = u8

impl Bits for [u8; 30][src]

type Store = u8

impl Bits for [u8; 31][src]

type Store = u8

impl Bits for [u8; 32][src]

type Store = u8

impl Bits for u16[src]

type Store = u16

impl Bits for [u16][src]

type Store = u16

impl Bits for [u16; 0][src]

type Store = u16

impl Bits for [u16; 1][src]

type Store = u16

impl Bits for [u16; 2][src]

type Store = u16

impl Bits for [u16; 3][src]

type Store = u16

impl Bits for [u16; 4][src]

type Store = u16

impl Bits for [u16; 5][src]

type Store = u16

impl Bits for [u16; 6][src]

type Store = u16

impl Bits for [u16; 7][src]

type Store = u16

impl Bits for [u16; 8][src]

type Store = u16

impl Bits for [u16; 9][src]

type Store = u16

impl Bits for [u16; 10][src]

type Store = u16

impl Bits for [u16; 11][src]

type Store = u16

impl Bits for [u16; 12][src]

type Store = u16

impl Bits for [u16; 13][src]

type Store = u16

impl Bits for [u16; 14][src]

type Store = u16

impl Bits for [u16; 15][src]

type Store = u16

impl Bits for [u16; 16][src]

type Store = u16

impl Bits for [u16; 17][src]

type Store = u16

impl Bits for [u16; 18][src]

type Store = u16

impl Bits for [u16; 19][src]

type Store = u16

impl Bits for [u16; 20][src]

type Store = u16

impl Bits for [u16; 21][src]

type Store = u16

impl Bits for [u16; 22][src]

type Store = u16

impl Bits for [u16; 23][src]

type Store = u16

impl Bits for [u16; 24][src]

type Store = u16

impl Bits for [u16; 25][src]

type Store = u16

impl Bits for [u16; 26][src]

type Store = u16

impl Bits for [u16; 27][src]

type Store = u16

impl Bits for [u16; 28][src]

type Store = u16

impl Bits for [u16; 29][src]

type Store = u16

impl Bits for [u16; 30][src]

type Store = u16

impl Bits for [u16; 31][src]

type Store = u16

impl Bits for [u16; 32][src]

type Store = u16

impl Bits for u32[src]

type Store = u32

impl Bits for [u32][src]

type Store = u32

impl Bits for [u32; 0][src]

type Store = u32

impl Bits for [u32; 1][src]

type Store = u32

impl Bits for [u32; 2][src]

type Store = u32

impl Bits for [u32; 3][src]

type Store = u32

impl Bits for [u32; 4][src]

type Store = u32

impl Bits for [u32; 5][src]

type Store = u32

impl Bits for [u32; 6][src]

type Store = u32

impl Bits for [u32; 7][src]

type Store = u32

impl Bits for [u32; 8][src]

type Store = u32

impl Bits for [u32; 9][src]

type Store = u32

impl Bits for [u32; 10][src]

type Store = u32

impl Bits for [u32; 11][src]

type Store = u32

impl Bits for [u32; 12][src]

type Store = u32

impl Bits for [u32; 13][src]

type Store = u32

impl Bits for [u32; 14][src]

type Store = u32

impl Bits for [u32; 15][src]

type Store = u32

impl Bits for [u32; 16][src]

type Store = u32

impl Bits for [u32; 17][src]

type Store = u32

impl Bits for [u32; 18][src]

type Store = u32

impl Bits for [u32; 19][src]

type Store = u32

impl Bits for [u32; 20][src]

type Store = u32

impl Bits for [u32; 21][src]

type Store = u32

impl Bits for [u32; 22][src]

type Store = u32

impl Bits for [u32; 23][src]

type Store = u32

impl Bits for [u32; 24][src]

type Store = u32

impl Bits for [u32; 25][src]

type Store = u32

impl Bits for [u32; 26][src]

type Store = u32

impl Bits for [u32; 27][src]

type Store = u32

impl Bits for [u32; 28][src]

type Store = u32

impl Bits for [u32; 29][src]

type Store = u32

impl Bits for [u32; 30][src]

type Store = u32

impl Bits for [u32; 31][src]

type Store = u32

impl Bits for [u32; 32][src]

type Store = u32

impl Bits for u64[src]

type Store = u64

impl Bits for [u64][src]

type Store = u64

impl Bits for [u64; 0][src]

type Store = u64

impl Bits for [u64; 1][src]

type Store = u64

impl Bits for [u64; 2][src]

type Store = u64

impl Bits for [u64; 3][src]

type Store = u64

impl Bits for [u64; 4][src]

type Store = u64

impl Bits for [u64; 5][src]

type Store = u64

impl Bits for [u64; 6][src]

type Store = u64

impl Bits for [u64; 7][src]

type Store = u64

impl Bits for [u64; 8][src]

type Store = u64

impl Bits for [u64; 9][src]

type Store = u64

impl Bits for [u64; 10][src]

type Store = u64

impl Bits for [u64; 11][src]

type Store = u64

impl Bits for [u64; 12][src]

type Store = u64

impl Bits for [u64; 13][src]

type Store = u64

impl Bits for [u64; 14][src]

type Store = u64

impl Bits for [u64; 15][src]

type Store = u64

impl Bits for [u64; 16][src]

type Store = u64

impl Bits for [u64; 17][src]

type Store = u64

impl Bits for [u64; 18][src]

type Store = u64

impl Bits for [u64; 19][src]

type Store = u64

impl Bits for [u64; 20][src]

type Store = u64

impl Bits for [u64; 21][src]

type Store = u64

impl Bits for [u64; 22][src]

type Store = u64

impl Bits for [u64; 23][src]

type Store = u64

impl Bits for [u64; 24][src]

type Store = u64

impl Bits for [u64; 25][src]

type Store = u64

impl Bits for [u64; 26][src]

type Store = u64

impl Bits for [u64; 27][src]

type Store = u64

impl Bits for [u64; 28][src]

type Store = u64

impl Bits for [u64; 29][src]

type Store = u64

impl Bits for [u64; 30][src]

type Store = u64

impl Bits for [u64; 31][src]

type Store = u64

impl Bits for [u64; 32][src]

type Store = u64

Loading content...

Implementors

Loading content...