Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub type ParseError = core::convert::Infallible
A type alias for convert::InfallibleInfallible.
type_alias alloc Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct String
A UTF-8–encoded, growable string.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_bytes(&self) -> &[u8]
Returns a byte slice of this String's contents.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut_str(&mut self) -> &mut str
Converts a String into a mutable string slice.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
Returns a mutable reference to the contents of this String.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_str(&self) -> &str
Extracts a string slice containing the entire String.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn capacity(&self) -> usize
Returns this String's capacity, in bytes.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Truncates this String, removing all contents.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn drain<R>(&mut self, range: R) -> Drain<'_>
Removes the specified range from the string in bulk, returning all removed characters as an iterator.
method alloc Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn extend_from_within<R>(&mut self, src: R)
Copies elements from src range to the end of the string.
method alloc Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw_parts(buf: *mut u8, length: usize, capacity: usize) -> String
Creates a new String from a pointer, a length and a capacity.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16(v: &[u16]) -> Result<String, FromUtf16Error>
Decode a native endian UTF-16–encoded vector v into a String, returning Err if v contains any invalid data.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16_lossy(v: &[u16]) -> String
Decode a native endian UTF-16–encoded slice v into a String, replacing invalid data with the replacement character (U+FFFD).
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16be(v: &[u8]) -> Result<String, FromUtf16Error>
Decode a UTF-16BE–encoded vector v into a String, returning Err if v contains any invalid data.
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16be_lossy(v: &[u8]) -> String
Decode a UTF-16BE–encoded slice v into a String, replacing invalid data with the replacement character (U+FFFD).
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16le(v: &[u8]) -> Result<String, FromUtf16Error>
Decode a UTF-16LE–encoded vector v into a String, returning Err if v contains any invalid data.
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf16le_lossy(v: &[u8]) -> String
Decode a UTF-16LE–encoded slice v into a String, replacing invalid data with the replacement character (U+FFFD).
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error>
Converts a vector of bytes to a String.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str>
Converts a slice of bytes to a string, including invalid characters.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_utf8_lossy_owned(v: Vec<u8>) -> String
Converts a Vec<u8> to a String, substituting invalid UTF-8 sequences with replacement characters.
associated_function alloc Stable since 1.100.0 Version 1.100.0-nightly
"I'm not here to tell you that Rust is the best language....... you should have figured that out by now."

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.