[][src]Struct bitvec::slice::Iter

pub struct Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
{ /* fields omitted */ }

Immutable slice iterator

This struct is created by the iter method on BitSlices.

Examples

Basic usage:

let data = 5u8;
let bits = data.bits::<LittleEndian>();

for bit in bits[.. 4].iter() {
    println!("{}", bit);
}

Methods

impl<'a, C, T> Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

pub fn as_bitslice(&self) -> &'a BitSlice<C, T>[src]

Views the underlying data as a subslice of the original data.

This has the same lifetime as the original slice, and so the iterator can continue to be used while this exists.

pub fn as_slice(&self) -> &'a [T][src]

Views the underlying buffer.

This has the same rules as BitSlice::as_slice.

Trait Implementations

impl<'_, C, T> AsRef<[T]> for Iter<'_, C, T> where
    C: Cursor,
    T: BitStore
[src]

impl<'_, C, T> AsRef<BitSlice<C, T>> for Iter<'_, C, T> where
    C: Cursor,
    T: BitStore
[src]

impl<'a, C: Clone, T: Clone> Clone for Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

impl<'a, C: Debug, T: Debug> Debug for Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

impl<'a, C, T> DoubleEndedIterator for Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

impl<'_, C, T> ExactSizeIterator for Iter<'_, C, T> where
    C: Cursor,
    T: BitStore
[src]

impl<'_, C, T> FusedIterator for Iter<'_, C, T> where
    C: Cursor,
    T: BitStore
[src]

impl<'a, C, T> Iterator for Iter<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

type Item = &'a bool

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, C, T> RefUnwindSafe for Iter<'a, C, T> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, C, T> Send for Iter<'a, C, T>

impl<'a, C, T> Sync for Iter<'a, C, T>

impl<'a, C, T> Unpin for Iter<'a, C, T>

impl<'a, C, T> UnwindSafe for Iter<'a, C, T> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.