Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn trim_left_matches<P>(&self, pat: P) -> &str
Returns a string slice with all prefixes that match a pattern repeatedly removed.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_left(&self) -> &str
Returns a string slice with leading whitespace removed.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_end_matches<P>(&self, pat: P) -> &str
Returns a string slice with all suffixes that match a pattern repeatedly removed.
method core Stable since 1.30.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_end(&self) -> &str
Returns a string slice with trailing whitespace removed.
method core Stable since 1.30.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii_start(&self) -> &str
Returns a string slice with leading ASCII whitespace removed.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii_end(&self) -> &str
Returns a string slice with trailing ASCII whitespace removed.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii(&self) -> &str
Returns a string slice with leading and trailing ASCII whitespace removed.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim(&self) -> &str
Returns a string slice with leading and trailing whitespace removed.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
fn from_str(s: &str) -> Result<Self, <Self as >::Err>
Parses a string s to return a value of this type.
associated_function core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
type Err
The associated error which can be returned from parsing.
associated_type core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub trait FromStr
Parse a value from a string
trait core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn substr_range(&self, substr: &str) -> Option<Range<usize>>
Returns the range that a substring 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<&str>
Returns a string slice with the suffix removed.
method core Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_prefix<P>(&self, prefix: P) -> Option<&str>
Returns a string slice with the prefix removed.
method core Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_circumfix<P, S>(&self, prefix: P, suffix: S) -> Option<&str>
Returns a string slice 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<P>(&self, pat: P) -> bool
Returns true if the given pattern matches a prefix of this string slice.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<'_, P>
Returns an iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most n items.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_whitespace(&self) -> SplitWhitespace<'_>
Splits a string slice by whitespace.
method core Stable since 1.1.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<'_, P>
Returns an iterator over substrings of the given string slice, separated by characters matched by a pattern.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
method core Stable since 1.52.0 Version 1.100.0-nightly
"The performance impact of moving to Rust – and this is a common theme across everything done when we've moved from C/C++ to Rust – we saw a 5 to 1..."

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.