Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn subslice_range(&self, subslice: &[T]) -> Option<core::range::Range<usize>>
Returns the range of indices that a subslice points to.
method core Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
Returns a subslice with the suffix removed.
method core Stable since 1.51.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
Returns a subslice with the prefix removed.
method core Stable since 1.51.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_circumfix<S, P>(&self, prefix: &P, suffix: &S) -> Option<&[T]>
Returns a subslice with the prefix and suffix removed.
method core Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn starts_with(&self, needle: &[T]) -> bool
Returns true if needle is a prefix 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 splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_off_mut<'a, R>(self: &mut &'a mut Self, range: R) -> Option<&'a mut Self>
Removes the subslice corresponding to the given range and returns a mutable reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_off_last_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>
Removes the last element of the slice and returns a mutable reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_off_last<'a>(self: &mut &'a Self) -> Option<&'a T>
Removes the last element of the slice and returns a reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_off_first_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>
Removes the first element of the slice and returns a mutable reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_off_first<'a>(self: &mut &'a Self) -> Option<&'a T>
Removes the first element of the slice and returns a reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_off<'a, R>(self: &mut &'a Self, range: R) -> Option<&'a Self>
Removes the subslice corresponding to the given range and returns a reference to it.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>
Returns the last and all the rest of the elements of the slice, or None if it is empty.
method core Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_last_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T], &mut [T; N])>
Returns a mutable array reference to the last N items in the slice and the remaining slice.
method core Stable since 1.77.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>
Returns an array reference to the last N items in the slice and the remaining slice.
method core Stable since 1.77.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn split_last(&self) -> Option<(&T, &[T])>
Returns the last and all the rest of the elements of the slice, or None if it is empty.
method core Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.
method core Stable since 1.51.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.
method core Stable since 1.51.0 Version 1.100.0-nightly
"> Rustaceans are not very imaginative at naming things. We try! and try!, but sometimes, we Err."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.