[][src]Struct rut::Decode

#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Decode<'a> { /* fields omitted */ }

An iterator that decodes characters from a byte slice.

This struct is created by the decode function. See its documentation for more.

Methods

impl<'_> Decode<'_>[src]

pub fn rest(&self) -> &[u8][src]

Returns the unprocessed part of the stored byte slice.

Example

// "ABC"
let bytes = &[0x41, 0x42, 0x43];

let mut d = rut::decode(bytes);

assert_eq!(d.next(), Some(Ok('A')));
assert_eq!(d.rest(), &[0x42, 0x43]);

Trait Implementations

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

impl<'_> FusedIterator for Decode<'_>[src]

impl<'_> Iterator for Decode<'_>[src]

type Item = Result<char, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> Send for Decode<'a>

impl<'a> Sync for Decode<'a>

impl<'a> Unpin for Decode<'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.