Struct core_extensions::slices::KeySlice
source · pub struct KeySlice<'a, T: 'a, U> {
pub slice: &'a [T],
pub key: U,
}
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§
source§impl<'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 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a, T: PartialOrd + 'a, U: PartialOrd> PartialOrd for KeySlice<'a, T, U>
impl<'a, T: PartialOrd + 'a, U: PartialOrd> PartialOrd for KeySlice<'a, T, U>
impl<'a, T: Eq + 'a, U: Eq> Eq for KeySlice<'a, T, U>
impl<'a, T: 'a, U> StructuralPartialEq for KeySlice<'a, T, U>
Auto Trait Implementations§
impl<'a, T, U> Freeze for KeySlice<'a, T, U>where
U: Freeze,
impl<'a, T, U> RefUnwindSafe for KeySlice<'a, T, U>where
U: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, U> Send for KeySlice<'a, T, U>
impl<'a, T, U> Sync for KeySlice<'a, T, U>
impl<'a, T, U> Unpin for KeySlice<'a, T, U>where
U: Unpin,
impl<'a, T, U> UnwindSafe for KeySlice<'a, T, U>where
U: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Emulates the pipeline operator, allowing method syntax in more places. Read more
source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
The same as
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moresource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
The same as
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Mutates self using a closure taking self by mutable reference,
passing it along the method chain. Read more
source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Observes the value of self, passing it along unmodified.
Useful in long method chains. Read more
source§fn as_ref_<T: ?Sized>(&self) -> &Twhere
Self: AsRef<T>,
fn as_ref_<T: ?Sized>(&self) -> &Twhere
Self: AsRef<T>,
Performs a reference to reference conversion with
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read moresource§impl<T> TypeIdentity for Twhere
T: ?Sized,
impl<T> TypeIdentity for Twhere
T: ?Sized,
source§fn as_type_mut(&mut self) -> &mut Self::Type
fn as_type_mut(&mut self) -> &mut Self::Type
Converts a mutable reference back to the original type.
source§fn into_type_box(self: Box<Self>) -> Box<Self::Type>
fn into_type_box(self: Box<Self>) -> Box<Self::Type>
Converts a box back to the original type.
source§fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
Converts an Arc back to the original type. Read more
source§fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
Converts an Rc back to the original type. Read more
source§fn from_type_ref(this: &Self::Type) -> &Self
fn from_type_ref(this: &Self::Type) -> &Self
Converts a reference back to the original type.
source§fn from_type_mut(this: &mut Self::Type) -> &mut Self
fn from_type_mut(this: &mut Self::Type) -> &mut Self
Converts a mutable reference back to the original type.
source§fn from_type_box(this: Box<Self::Type>) -> Box<Self>
fn from_type_box(this: Box<Self::Type>) -> Box<Self>
Converts a box back to the original type.