Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn leak<'a>(self) -> &'a mut str
Consumes and leaks the String, returning a mutable reference to the contents, &'a mut str.
method alloc Stable since 1.72.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_empty(&self) -> bool
Returns true if this String has a length of zero, and false otherwise.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw_parts(self) -> (*mut u8, usize, usize)
Decomposes a String into its raw components: (pointer, length, capacity).
method alloc Stable since 1.93.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn into_bytes(self) -> Vec<u8>
Converts a String into a byte vector.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_boxed_str(self) -> Box<str>
Converts this String into a Box<strstr>.
method alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert_str(&mut self, idx: usize, string: &str)
Inserts a string slice into this String at byte position idx.
method alloc Stable since 1.16.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert(&mut self, idx: usize, ch: char)
Inserts a character into this String at byte position idx.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String
Converts a vector of bytes to a String without checking that the string contains valid UTF-8.
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
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(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_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_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_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_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_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_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 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 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 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
"A rustacean is a programmer that dislikes being told "yes" in situations where they'll regret it later."

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.