Struct spinoso_string::IntoIter[][src]

pub struct IntoIter(_);

An iterator that moves out of a string.

This struct is created by the into_iter method on String (provided by the IntoIterator trait).

Examples

use spinoso_string::String;

let s = String::from("hello");
let iter: spinoso_string::IntoIter = s.into_iter();

Implementations

impl IntoIter[src]

#[must_use]pub fn as_slice(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the remaining bytes of this iterator as a slice.

Examples

use spinoso_string::String;

let s = String::from("abc");
let mut into_iter = s.into_iter();
assert_eq!(into_iter.as_slice(), &[b'a', b'b', b'c']);
let _ = into_iter.next().unwrap();
assert_eq!(into_iter.as_slice(), &[b'b', b'c']);

#[must_use]pub fn as_mut_slice(&mut self) -> &mut [u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the remaining bytes of this iterator as a mutable slice.

Examples

use spinoso_string::String;

let s = String::from("abc");
let mut into_iter = s.into_iter();
assert_eq!(into_iter.as_slice(), &[b'a', b'b', b'c']);
into_iter.as_mut_slice()[2] = b'z';
assert_eq!(into_iter.next(), Some(b'a'));
assert_eq!(into_iter.next(), Some(b'b'));
assert_eq!(into_iter.next(), Some(b'z'));
assert_eq!(into_iter.next(), None);

Trait Implementations

impl AsRef<[u8]> for IntoIter[src]

impl Debug for IntoIter[src]

impl DoubleEndedIterator for IntoIter[src]

impl ExactSizeIterator for IntoIter[src]

impl FusedIterator for IntoIter[src]

impl Iterator for IntoIter[src]

type Item = u8

The type of the elements being iterated over.

Auto Trait Implementations

impl RefUnwindSafe for IntoIter

impl Send for IntoIter

impl Sync for IntoIter

impl Unpin for IntoIter

impl UnwindSafe for IntoIter

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.