Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub const fn is_empty(self) -> bool
Returns true if the non-null raw slice has a length of 0.
method core Stable since 1.79.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_aligned(self) -> bool
Returns whether the pointer is properly aligned for T.
method core Stable since 1.79.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_ref(r: &T) -> Self
Converts a reference to a NonNull pointer.
associated_function core Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_mut(r: &mut T) -> Self
Converts a mutable reference to a NonNull pointer.
associated_function core Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn expose_provenance(self) -> NonZero<usize>
Exposes the "provenance" part of the pointer for future use in with_exposed_provenance and returns the "address" portion.
method core Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn drop_in_place(self)
Executes the destructor (if any) of the pointed-to value.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn dangling() -> Self
Creates a new NonNull that is dangling, but well-aligned.
associated_function core Stable since 1.25.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize)
Copies count * size_of::<T>() bytes from self to dest. The source and destination may not overlap.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize)
Copies count * size_of::<T>() bytes from self to dest. The source and destination may overlap.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize)
Copies count * size_of::<T>() bytes from src to self. The source and destination may not overlap.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize)
Copies count * size_of::<T>() bytes from src to self. The source and destination may overlap.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn cast<U>(self) -> NonNull<U>
Casts to a pointer of another type.
method core Stable since 1.27.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_sub(self, count: usize) -> Self
Calculates the offset from a pointer in bytes (convenience for .byte_offset((count as isize).wrapping_neg())).
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_offset_from_unsigned<U>(self, origin: NonNull<U>) -> usize
Calculates the distance between two pointers within the same allocation, where it's known that self is equal to or greater than origin. The returned value is in units of bytes.
method core Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_offset_from<U>(self, origin: NonNull<U>) -> isize
Calculates the distance between two pointers within the same allocation. The returned value is in units of bytes.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_offset(self, count: isize) -> Self
Calculates the offset from a pointer in bytes.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_add(self, count: usize) -> Self
Calculates the offset from a pointer in bytes (convenience for .byte_offset(count as isize)).
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_ref<'a>(&self) -> &'a T
Returns a shared reference to the value. If the value may be uninitialized, as_uninit_ref must be used instead.
method core Stable since 1.25.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_ptr(self) -> *mut T
Acquires the underlying *mut pointer.
method core Stable since 1.25.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn as_mut<'a>(&mut self) -> &'a mut T
Returns a unique reference to the value. If the value may be uninitialized, as_uninit_mut must be used instead.
method core Stable since 1.25.0 Version 1.100.0-nightly
"Yeah, it's like learning to dance when your partner [borrow checker] already knows all the steps. When you're just getting started, you step on their ..."

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.