Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
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 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 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 mod core
The Rust Core Library
module core Stable since 1.6.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 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
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
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 dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates the block of memory at the given ptr pointer with the given layout.
method core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
Shrinks or grows a block of memory to the given new_size in bytes. The block is described by the given ptr pointer and layout.
method core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Layout
Layout of a block of memory.
struct core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn align(&self) -> usize
The minimum byte alignment for a memory block of this layout.
method core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError>
Creates a layout describing the record that can hold a value of the same layout as self, but that also is aligned to alignment align (measured in bytes).
method core Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn array<T>(n: usize) -> Result<Self, LayoutError>
Creates a layout describing the record for a [T; n].
associated_function core Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn dangling_ptr(&self) -> NonNull<u8>
Creates a NonNull that is dangling, but well-aligned for this Layout.
method core Stable since 1.95.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError>
Creates a layout describing the record for self followed by next, including any necessary padding to ensure that next will be properly aligned, but no trailing padding.
method core Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn extend_packed(&self, next: Self) -> Result<Self, LayoutError>
Creates a layout describing the record for self followed by next with no additional padding between the two. Since no padding is inserted, the alignment of next is irrelevant, and is not incorporated at all into the resulting layout.
method core Stable since 1.95.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn for_value<T>(t: &T) -> Self
Produces layout describing a record that could be used to allocate backing structure for T (which could be a trait or other unsized type like a slice).
associated_function core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn for_value_raw<T>(val: *const T) -> Self
Produces layout describing a record that could be used to allocate backing structure for T (which could be a trait or other unsized type like a slice).
associated_function core Stable since 1.100.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutError>
Constructs a Layout from a given size and align, or returns LayoutError if any of the following conditions are not met:
associated_function core Stable since 1.28.0 Version 1.100.0-nightly
"Python and Go pick up your trash for you. C lets you litter everywhere, but throws a fit when it steps on your banana peel. Rust slaps you and demands..."

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.