Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn new(x: T) -> Self
Allocates memory on the heap and then places x into it.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn leak<'a>(b: Self) -> &'a mut T
Consumes and leaks the Box, returning a mutable reference, &'a mut T.
associated_function alloc Stable since 1.26.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(b: Self) -> *mut T
Consumes the Box, returning a wrapped raw pointer.
associated_function alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_pin(boxed: Self) -> Pin<Self>
Converts a Box<T> into a Pin<Box<T>>. If T does not implement Unpin, then *boxed will be pinned in memory and unable to be moved.
associated_function alloc Stable since 1.63.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_non_null(b: Self) -> NonNull<T>
Consumes the Box, returning a wrapped NonNull pointer.
associated_function alloc Stable since 1.100.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(raw: *mut T) -> Self
Constructs a box from a raw pointer.
associated_function alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_non_null(ptr: NonNull<T>) -> Self
Constructs a box from a NonNull pointer.
associated_function alloc Stable since 1.100.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn downcast<T>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn assume_init(self) -> Box<T, A>
Converts to Box<T, A>.
method alloc Stable since 1.82.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_ptr(b: &Self) -> *const T
Returns a raw pointer to the Box's contents.
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_mut_ptr(b: &mut Self) -> *mut T
Returns a raw mutable pointer to the Box's contents.
associated_function alloc Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Box<T, A>
A pointer type that uniquely owns a heap allocation of type T.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod boxed
The Box<T> type for heap allocation.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
fn to_owned(&self) -> <Self as >::Owned
Creates owned data from borrowed data, usually by cloning.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
fn clone_into(&self, target: &mut <Self as >::Owned)
Uses borrowed data to replace owned data, usually by cloning.
method alloc Stable since 1.63.0 Version 1.100.0-nightly
doc.rust-lang.org
type Owned
The resulting type after obtaining ownership.
associated_type alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub trait ToOwned
A generalization of Clone to borrowed data.
trait alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned
Acquires a mutable reference to the owned form of the data.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_owned(self) -> <B as ToOwned>::Owned
Extracts the owned data.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub enum Cow<'a, B>
A clone-on-write smart pointer.
enum alloc Stable since 1.0.0 Version 1.100.0-nightly
"In theory it would be entirely reasonable to guess that most Rust projects would need to use a significant amount of unsafe code to escape the limitat..."

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.