Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like alloc, but also ensures that the contents are set to zero before being returned.
method core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given layout.
method core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe trait GlobalAlloc
A memory allocator that can be registered as the standard library’s default through the #[global_allocator] attribute.
trait core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod alloc
Memory allocation APIs
module core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod core
The Rust Core Library
module core Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Splice<'a, I, A>
A splicing iterator for Vec.
struct alloc Stable since 1.21.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns the remaining items of this iterator as a slice.
method alloc Stable since 1.15.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns the remaining items of this iterator as a mutable slice.
method alloc Stable since 1.15.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct IntoIter<T, A>
An iterator that moves out of a vector.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct ExtractIf<'a, T, F, A>
An iterator which uses a closure to determine if an element should be removed.
struct alloc Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns the remaining items of this iterator as a slice.
method alloc Stable since 1.46.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Drain<'a, T, A>
A draining iterator for Vec<T>.
struct alloc Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn with_capacity(capacity: usize) -> Self
Constructs a new, empty Vec<T> with at least the specified capacity.
associated_function alloc Stable since 1.0.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 elements to be inserted in the given Vec<T>. 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 try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional more elements to be inserted in the given Vec<T>. The collection may reserve more space to speculatively avoid frequent reallocations. 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 truncate(&mut self, len: usize)
Shortens the vector, keeping the first len elements and dropping the rest.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn swap_remove(&mut self, index: usize) -> T
Removes an element from the vector and returns it.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_off(&mut self, at: usize) -> Self
Splits the collection into two at the given index.
method alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, <I as >::IntoIter, A>
Creates a splicing iterator that replaces the specified range in the vector with the given replace_with iterator and yields the removed items. replace_with does not need to be the same length as range.
method alloc Stable since 1.21.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]
Returns the remaining spare capacity of the vector as a slice of MaybeUninit<T>.
method alloc Stable since 1.60.0 Version 1.100.0-nightly
"Rust is funny because in one sense it's hard and clunky. However, it's only ever *precisely as hard and clunky as it needs to be*. Everywhere somethin..."

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.