Struct Last
pub struct Last;
Always accesses the last element of the slice.
Examples
use Last;
use SliceIndex;
let s = &;
assert_eq!;
assert_eq!;
Trait Implementations
impl Debug for Last
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T> SliceIndex<[T]> for Last
type Output = T;fn get(self, slice: &[T]) -> Option<&Self::Output>fn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output>unsafe fn get_unchecked(self, slice: *const [T]) -> *const Self::Outputunsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut Self::Outputfn index(self, slice: &[T]) -> &Self::Outputfn index_mut(self, slice: &mut [T]) -> &mut Self::Output
Auto Trait Implementations
impl Freeze for Last
impl RefUnwindSafe for Last
impl Send for Last
impl Sync for Last
impl Unpin for Last
impl UnsafeUnpin for Last
impl UnwindSafe for Last
Blanket Implementations
impl<T> Any for Last
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Last
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Last
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Last
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Last
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Last
impl<T, U> Into<U> for Last
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Last
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Last
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>