Struct DrainBytes

struct DrainBytes<'a> { ... }

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());

Implementations

impl<'a> Debug for DrainBytes<'a>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'a> DoubleEndedIterator for DrainBytes<'a>

fn next_back(self: &mut Self) -> Option<u8>

impl<'a> ExactSizeIterator for DrainBytes<'a>

fn len(self: &Self) -> usize

impl<'a> Freeze for DrainBytes<'a>

impl<'a> FusedIterator for DrainBytes<'a>

impl<'a> Iterator for DrainBytes<'a>

fn next(self: &mut Self) -> Option<u8>

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> UnsafeUnpin for DrainBytes<'a>

impl<'a> UnwindSafe for DrainBytes<'a>

impl<I> IntoIterator for DrainBytes<'a>

fn into_iter(self: Self) -> I

impl<T> Any for DrainBytes<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for DrainBytes<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for DrainBytes<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for DrainBytes<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for DrainBytes<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for DrainBytes<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for DrainBytes<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>