Struct core_extensions::slices::KeySlice
source · [−]pub struct KeySlice<'a, T: 'a, U> {
pub slice: &'a [T],
pub key: U,
}
slices
only.Expand description
A pair of (slice, key) returned by the RSplitSliceWhile/ SplitSliceWhile iterators.
Fields
slice: &'a [T]
A slice where every element was mapped to the same key by a closure.
key: U
The value that all the elements in the slice were mapped to.
Implementations
Trait Implementations
sourceimpl<'a, T: Ord + 'a, U: Ord> Ord for KeySlice<'a, T, U>
impl<'a, T: Ord + 'a, U: Ord> Ord for KeySlice<'a, T, U>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a, T: PartialEq + 'a, U: PartialEq> PartialEq<KeySlice<'a, T, U>> for KeySlice<'a, T, U>
impl<'a, T: PartialEq + 'a, U: PartialEq> PartialEq<KeySlice<'a, T, U>> for KeySlice<'a, T, U>
sourceimpl<'a, T: PartialOrd + 'a, U: PartialOrd> PartialOrd<KeySlice<'a, T, U>> for KeySlice<'a, T, U>
impl<'a, T: PartialOrd + 'a, U: PartialOrd> PartialOrd<KeySlice<'a, T, U>> for KeySlice<'a, T, U>
sourcefn partial_cmp(&self, other: &KeySlice<'a, T, U>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeySlice<'a, T, U>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, T: Eq + 'a, U: Eq> Eq for KeySlice<'a, T, U>
impl<'a, T: 'a, U> StructuralEq for KeySlice<'a, T, U>
impl<'a, T: 'a, U> StructuralPartialEq for KeySlice<'a, T, U>
Auto Trait Implementations
impl<'a, T, U> RefUnwindSafe for KeySlice<'a, T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
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,
Blanket Implementations
sourceimpl<T> AsPhantomData for T where
T: ?Sized,
impl<T> AsPhantomData for T where
T: ?Sized,
sourcefn as_phantom(&self) -> PhantomData<Self>
fn as_phantom(&self) -> PhantomData<Self>
phantom
only.Gets a PhantomData<Self>
. Read more
sourcefn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
fn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
phantom
only.Gets a PhantomData<fn() -> Self>
, a covariant PhantomData
.
sourcefn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
fn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
.
sourcefn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
fn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
.
sourceconst PHANTOM: PhantomData<Self> = PhantomData
const PHANTOM: PhantomData<Self> = PhantomData
phantom
only.Gets a PhantomData<Self>
. Read more
sourceconst PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
const PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
phantom
only.Constructs a PhantomData<fn() -> T>
, a covariant PhantomData
. Read more
sourceconst PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
const PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
. Read more
sourceconst PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
const PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallExt for T where
T: ?Sized,
impl<T> CallExt for T where
T: ?Sized,
sourcefn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
fn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
callable
only.For calling CallRef::ref_call_
,
with the ability to specify the types of the arguments.. Read more