[][src]Struct bstr::DrainBytes

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

A draining byte oriented iterator for Vec<u8>.

This iterator is created by ByteVec::drain_bytes.

Examples

Basic usage:

use bstr::ByteVec;

let mut s = Vec::from("foobar");
{
    let mut drainer = s.drain_bytes(2..4);
    assert_eq!(drainer.next(), Some(b'o'));
    assert_eq!(drainer.next(), Some(b'b'));
    assert_eq!(drainer.next(), None);
}
assert_eq!(s, "foar".as_bytes());

Trait Implementations

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

impl<'a> DoubleEndedIterator for DrainBytes<'a>[src]

impl<'a> ExactSizeIterator for DrainBytes<'a>[src]

impl<'a> FusedIterator for DrainBytes<'a>[src]

impl<'a> Iterator for DrainBytes<'a>[src]

type Item = u8

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for DrainBytes<'a>

impl<'a> Send for DrainBytes<'a>

impl<'a> Sync for DrainBytes<'a>

impl<'a> Unpin for DrainBytes<'a>

impl<'a> UnwindSafe for DrainBytes<'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<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, 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.