[][src]Struct core_extensions::strings::KeyStr

pub struct KeyStr<'a, T> {
    pub str: &'a str,
    pub key: T,
}

KeyStr is a pair of (str_slice,key) returned from the (R)SplitWhile iterators.

str_slice is the string slice in which mapper returned the same key for every character.

key is the last value returned by mapper

mapper is a closure of the type impl FnMut(char) -> T

Fields

str: &'a str

The string slice where the sequence of values returned by mapper compared equal.

key: T

The last value that compared equal (in a sequence) returned by mapper .

Methods

impl<'a, T> KeyStr<'a, T>[src]

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

Accessor for the underlying &'a str.

pub fn into_pair(self) -> (T, &'a str)[src]

Converts this KeyStr into a key/string slice pair

Trait Implementations

impl<'a, T: Debug> Debug for KeyStr<'a, T>[src]

impl<'a, T: PartialEq> PartialEq<KeyStr<'a, T>> for KeyStr<'a, T>[src]

impl<'a, T: Eq> Eq for KeyStr<'a, T>[src]

impl<'a, T: Ord> Ord for KeyStr<'a, T>[src]

impl<'a, T: PartialOrd> PartialOrd<KeyStr<'a, T>> for KeyStr<'a, T>[src]

impl<'a, T> StructuralPartialEq for KeyStr<'a, T>[src]

impl<'a, T> StructuralEq for KeyStr<'a, T>[src]

impl<'a, T: Clone> Clone for KeyStr<'a, T>[src]

Auto Trait Implementations

impl<'a, T> Unpin for KeyStr<'a, T> where
    T: Unpin

impl<'a, T> Send for KeyStr<'a, T> where
    T: Send

impl<'a, T> Sync for KeyStr<'a, T> where
    T: Sync

impl<'a, T> UnwindSafe for KeyStr<'a, T> where
    T: UnwindSafe

impl<'a, T> RefUnwindSafe for KeyStr<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

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.

impl<T> From<T> for T[src]

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

type Error = !

The type returned in the event of a conversion error.

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.