[][src]Struct abi_stable::std_types::string::Drain

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

An Iterator returned by RString::drain , which removes and yields all the characters in a range from the RString.

Methods

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

pub fn as_str(&self) -> &str[src]

Returns a string slice over the remainder of the string that is being drained.

Example

use abi_stable::std_types::RString;

let mut string=RString::from("abcdefg");
let mut iter=string.drain(2..6);

assert_eq!(iter.as_str(),"cdef");

assert_eq!(iter.next(),Some('c'));
assert_eq!(iter.as_str(),"def");

assert_eq!(iter.next_back(),Some('f'));
assert_eq!(iter.as_str(),"de");

drop(iter);

assert_eq!(string.as_str(),"abg")

Trait Implementations

impl<'a> Send for Drain<'a>[src]

impl<'a> Sync for Drain<'a>[src]

impl<'a> Drop for Drain<'a>[src]

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

type Item = char

The type of the elements being iterated over.

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

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

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

Auto Trait Implementations

impl<'a> Unpin for Drain<'a>

impl<'a> !UnwindSafe for Drain<'a>

impl<'a> RefUnwindSafe for Drain<'a>

Blanket Implementations

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more

impl<I> IteratorExt for I where
    I: Iterator
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.