Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn split_off(&mut self, at: usize) -> String
Splits the string into two at the given byte index.
method alloc Stable since 1.16.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn truncate(&mut self, new_len: usize)
Shortens this String to the specified length.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional bytes more than the current length. The allocator may reserve more space to speculatively avoid frequent allocations. After calling try_reserve, capacity will be greater than or equal to self.len() + additional if it returns Ok(()). Does nothing if capacity is already sufficient. This method preserves the contents even if an error occurs.
method alloc Stable since 1.57.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve the minimum capacity for at least additional bytes more than the current length. Unlike try_reserve, this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling try_reserve_exact, capacity will be greater than or equal to self.len() + additional if it returns Ok(()). Does nothing if the capacity is already sufficient.
method alloc Stable since 1.57.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn with_capacity(capacity: usize) -> String
Creates a new empty String with at least the specified capacity.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub trait ToString
A trait for converting a value to a String.
trait alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
fn to_string(&self) -> String
Converts the given value to a String.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod sync
Thread-safe reference-counting pointers.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Arc<T, A>
A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_ptr(this: &Self) -> *const T
Provides a raw pointer to the data.
associated_function alloc Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn assume_init(self) -> Arc<T, A>
Converts to Arc<T>.
method alloc Stable since 1.82.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn decrement_strong_count(ptr: *const T)
Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.
associated_function alloc Stable since 1.51.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn downcast<T>(self) -> Result<Arc<T, A>, Self>
Attempts to downcast the Arc<dyn Any + Send + Sync> to a concrete type.
method alloc Stable since 1.29.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn downgrade(this: &Self) -> Weak<T, A>
Creates a new Weak pointer to this allocation.
associated_function alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(ptr: *const T) -> Self
Constructs an Arc<T> from a raw pointer.
associated_function alloc Stable since 1.17.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(this: &mut Self) -> Option<&mut T>
Returns a mutable reference into the given Arc, if there are no other Arc or Weak pointers to the same allocation.
associated_function alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn increment_strong_count(ptr: *const T)
Increments the strong reference count on the Arc<T> associated with the provided pointer by one.
associated_function alloc Stable since 1.51.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_inner(this: Self) -> Option<T>
Returns the inner value, if the Arc has exactly one strong reference.
associated_function alloc Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(this: Self) -> *const T
Consumes the Arc, returning the wrapped pointer.
associated_function alloc Stable since 1.17.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn make_mut(this: &mut Self) -> &mut T
Makes a mutable reference into the given Arc.
associated_function alloc Stable since 1.4.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.