Struct spinoso_string::IterMut[][src]

pub struct IterMut<'a>(_);

Mutable String byte iterator.

This struct is created by the iter_mut method on a Spinoso String. See its documentation for more.

Examples

let mut s = String::utf8(b"Artichoke Ruby".to_vec());

for byte in s.iter_mut() {
    *byte = b'z';
}
assert_eq!(s, "zzzzzzzzzzzzzz");

Implementations

impl<'a> IterMut<'a>[src]

#[must_use]pub fn into_slice(self) -> &'a mut [u8]

Notable traits for &'_ [u8]

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

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

To avoid creating &mut references that alias, this is forced to consume the iterator.

Examples

let mut s = String::utf8(b"Artichoke Ruby".to_vec());
{
    let mut iter = s.iter_mut();
    iter.next();
    assert_eq!(iter.into_slice(), b"rtichoke Ruby");
}
{
    let mut iter = s.iter_mut();
    *iter.next().unwrap() = b'a';
    *iter.nth(9).unwrap() = b'r';
}
assert_eq!(s, &b"artichoke ruby"[..]);

Trait Implementations

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

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

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

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

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

type Item = &'a mut u8

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for IterMut<'a>

impl<'a> Send for IterMut<'a>

impl<'a> Sync for IterMut<'a>

impl<'a> Unpin for IterMut<'a>

impl<'a> !UnwindSafe for IterMut<'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.