doc.rust-lang.org
pub const unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut <I as >::Output
Returns a mutable reference to an element or subslice, without doing bounds checking.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn get_unchecked<I>(&self, index: I) -> &<I as >::Output
Returns a reference to an element or subslice, without doing bounds checking.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn get_mut<I>(&mut self, index: I) -> Option<&mut <I as >::Output>
Returns a mutable reference to an element or subslice depending on the type of index (see get) or None if the index is out of bounds.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn get_disjoint_unchecked_mut<I, const N: usize>(&mut self, indices: [I; N]) -> [&mut <I as >::Output; N]
Returns mutable references to many indices at once, without doing any checks.
method
core
Stable since 1.86.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_disjoint_mut<I, const N: usize>(&mut self, indices: [I; N]) -> Result<[&mut <I as >::Output; N], GetDisjointMutError>
Returns mutable references to many indices at once.
method
core
Stable since 1.86.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn get<I>(&self, index: I) -> Option<&<I as >::Output>
Returns a reference to an element or subslice depending on the type of index.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn first_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the first element of the slice, or None if it is empty.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>
Returns a mutable array reference to the first N items in the slice.
method
core
Stable since 1.77.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>
Returns an array reference to the first N items in the slice.
method
core
Stable since 1.77.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn first(&self) -> Option<&T>
Returns the first element of the slice, or None if it is empty.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn fill_with<F>(&mut self, f: F)
Fills self with elements returned by calling a closure repeatedly.
method
core
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn fill(&mut self, value: T)
Fills self with elements by cloning value.
method
core
Stable since 1.50.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn escape_ascii(&self) -> EscapeAscii<'_>
Returns an iterator that produces an escaped version of this slice, treating it as an ASCII string.
method
core
Stable since 1.60.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool
Checks that two slices are an ASCII case-insensitive match.
method
core
Stable since 1.23.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn ends_with(&self, needle: &[T]) -> bool
Returns true if needle is a suffix of the slice or equal to the slice.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn element_offset(&self, element: &T) -> Option<usize>
Returns the index that an element reference points to.
method
core
Stable since 1.94.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn copy_within<R>(&mut self, src: R, dest: usize)
Copies elements from one part of the slice to another part of itself, using a memmove.
method
core
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn copy_from_slice(&mut self, src: &[T])
Copies all elements from src into self, using a memcpy.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn contains(&self, x: &T) -> bool
Returns true if the slice contains an element with the given value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn clone_from_slice(&mut self, src: &[T])
Copies the elements from src into self.
method
core
Stable since 1.7.0
Version 1.100.0-nightly