Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub type NonZeroU16 = NonZero<u16>
A u16 that is known not to equal zero.
type_alias core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroU128 = NonZero<u128>
A u128 that is known not to equal zero.
type_alias core Stable since 1.28.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroIsize = NonZero<isize>
An isize that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI8 = NonZero<i8>
An i8 that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI64 = NonZero<i64>
An i64 that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI32 = NonZero<i32>
An i32 that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI16 = NonZero<i16>
An i16 that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroI128 = NonZero<i128>
An i128 that is known not to equal zero.
type_alias core Stable since 1.34.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn wrapping_neg(self) -> Self
Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type.
method core Stable since 1.71.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn wrapping_abs(self) -> Self
Wrapping absolute value, see i8::wrapping_abs.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unsigned_abs(self) -> NonZero<u8>
Computes the absolute value of self without any wrapping or panicking.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of self.
method core Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_pow(self, other: u32) -> Self
Raise non-zero value to an integer power. Return NonZero::<u8>::MAX on overflow.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_neg(self) -> Self
Saturating negation. Computes -self, returning NonZero::<i8>::MAX if self == NonZero::<i8>::MIN instead of overflowing.
method core Stable since 1.71.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_mul(self, other: Self) -> Self
Multiplies two non-zero integers together. Return NonZero::<u8>::MAX on overflow.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_add(self, other: u8) -> Self
Adds an unsigned integer to a non-zero value. Return NonZero::<u8>::MAX on overflow.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn saturating_abs(self) -> Self
Saturating absolute value, see i8::saturating_abs.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn overflowing_neg(self) -> (Self, bool)
Negates self, overflowing if this is equal to the minimum value.
method core Stable since 1.71.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn overflowing_abs(self) -> (Self, bool)
Computes the absolute value of self, with overflow information, see i8::overflowing_abs.
method core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn new_unchecked(n: T) -> Self
Creates a non-zero without checking whether the value is non-zero. This results in undefined behavior if the value is zero.
associated_function core Stable since 1.28.0 Version 1.100.0-nightly
"I'm trying to round up to next power of two (for fun). I know that's perhaps not a lot of fun, but there's [next_power_of_two() ](https://doc.rust-lan..."

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.