[−][src]Trait bitvec::bits::Bits
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
Loading content...Required methods
fn as_bitslice<C>(&self) -> &BitSlice<C, Self::Store> where
C: Cursor,
C: Cursor,
Constructs a BitSlice
reference over data.
Type Parameters
C: Cursor
: TheCursor
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]);