[][src]Struct core_extensions::slices::KeySlice

pub struct KeySlice<'a, T: 'a, U> {
    pub slice: &'a [T],
    pub key: U,
}

KeySlice is a pair of (slice,key) returned from the (R)SplitSliceWhile iterators.

slice is the 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(&'a T) -> U

Fields

slice: &'a [T]

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

key: U

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

Methods

impl<'a, T, U> KeySlice<'a, T, U>[src]

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

Accessor for the underlying &'a [T].

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

Converts this KeySlice into a key/slice pair.

Trait Implementations

impl<'a, T: Clone + 'a, U: Clone> Clone for KeySlice<'a, T, U>[src]

impl<'a, T: Eq + 'a, U: Eq> Eq for KeySlice<'a, T, U>[src]

impl<'a, T: Ord + 'a, U: Ord> Ord for KeySlice<'a, T, U>[src]

impl<'a, T: PartialEq + 'a, U: PartialEq> PartialEq<KeySlice<'a, T, U>> for KeySlice<'a, T, U>[src]

impl<'a, T: PartialOrd + 'a, U: PartialOrd> PartialOrd<KeySlice<'a, T, U>> for KeySlice<'a, T, U>[src]

impl<'a, T: Debug + 'a, U: Debug> Debug for KeySlice<'a, T, U>[src]

impl<'a, T: 'a, U> StructuralPartialEq for KeySlice<'a, T, U>[src]

impl<'a, T: 'a, U> StructuralEq for KeySlice<'a, T, U>[src]

Auto Trait Implementations

impl<'a, T, U> Send for KeySlice<'a, T, U> where
    T: Sync,
    U: Send

impl<'a, T, U> Sync for KeySlice<'a, T, U> where
    T: Sync,
    U: Sync

impl<'a, T, U> Unpin for KeySlice<'a, T, U> where
    U: Unpin

impl<'a, T, U> UnwindSafe for KeySlice<'a, T, U> where
    T: RefUnwindSafe,
    U: UnwindSafe

impl<'a, T, U> RefUnwindSafe for KeySlice<'a, T, U> where
    T: RefUnwindSafe,
    U: 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, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]