[][src]Struct gf::support::bitvec::BitSlice

pub struct BitSlice<'a> { /* fields omitted */ }

An immutable bit slice.

Implementations

impl<'a> BitSlice<'a>[src]

pub fn from_byte_slice(slice: &'a [u8]) -> Self[src]

Wrap a little endian byte slice into a bit slice.

pub fn from_byte_slice_range<R: RangeBounds<usize>>(
    slice: &'a [u8],
    bit_range: R
) -> Self
[src]

Wrap a bit range of a little endian byte slice into a bit slice.

Errors

  • Panics on out-of-bound indexing.

pub fn is_empty(&self) -> bool[src]

Return whether the slice is empty.

pub fn len(&self) -> usize[src]

Return bit length of the slice.

pub fn get(&self, bit_index: usize) -> bool[src]

Return bit value at bit_index.

Errors

  • Panics on out-of-bound indexing.

pub fn subslice<R: RangeBounds<usize>>(self, bit_range: R) -> Self[src]

Return a subslice of this slice.

Errors

  • Panics on out-of-bound indexing.

pub fn to_bit_vec(self) -> BitVec[src]

Convert a slice to a vector.

Trait Implementations

impl<'a> BitSeq for BitSlice<'a>[src]

impl<'a> Clone for BitSlice<'a>[src]

impl<'a> Copy for BitSlice<'a>[src]

impl<'a> Debug for BitSlice<'a>[src]

impl<'a> From<BitSlice<'a>> for BitVec[src]

impl<'a> Index<usize> for BitSlice<'a>[src]

type Output = bool

The returned type after indexing.

Auto Trait Implementations

impl<'a> RefUnwindSafe for BitSlice<'a>

impl<'a> Send for BitSlice<'a>

impl<'a> Sync for BitSlice<'a>

impl<'a> Unpin for BitSlice<'a>

impl<'a> UnwindSafe for BitSlice<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.