pub struct Last;🔬This is a nightly-only experimental API. (
sliceindex_wrappers #146179)Expand description
Always accesses the last element of the slice.
§Examples
Trait Implementations§
Source§impl<T> SliceIndex<[T]> for Last
impl<T> SliceIndex<[T]> for Last
Source§fn get(self, slice: &[T]) -> Option<&Self::Output>
fn get(self, slice: &[T]) -> Option<&Self::Output>
🔬This is a nightly-only experimental API. (
slice_index_methods)Returns a shared reference to the output at this location, if in
bounds.
Source§fn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output>
fn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output>
🔬This is a nightly-only experimental API. (
slice_index_methods)Returns a mutable reference to the output at this location, if in
bounds.
Source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const Self::Output
unsafe fn get_unchecked(self, slice: *const [T]) -> *const Self::Output
🔬This is a nightly-only experimental API. (
slice_index_methods)Returns a pointer to the output at this location, without
performing any bounds checking. Read more
Source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut Self::Output
unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut Self::Output
🔬This is a nightly-only experimental API. (
slice_index_methods)Returns a mutable pointer to the output at this location, without
performing any bounds checking. Read more
Auto Trait Implementations§
impl Freeze for Last
impl RefUnwindSafe for Last
impl Send for Last
impl Sync for Last
impl Unpin for Last
impl UnwindSafe for Last
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