Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub struct FromBytesUntilNulError
An error indicating that no nul byte was present.
struct core Stable since 1.69.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_str(&self) -> Result<&str, str::Utf8Error>
Yields a &strstr slice if the CStr contains valid UTF-8.
method core Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_bytes_with_nul(&self) -> &[u8]
Converts this C string to a byte slice containing the trailing 0 byte.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_bytes(&self) -> &[u8]
Converts this C string to a byte slice.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_empty(&self) -> bool
Returns true if self.to_bytes() has a length of 0.
method core Stable since 1.71.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr
Wraps a raw C string with a safe C string wrapper.
associated_function core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr
Unsafely creates a C string wrapper from a byte slice.
associated_function core Stable since 1.10.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>
Creates a C string wrapper from a byte slice with exactly one nul terminator.
associated_function core Stable since 1.10.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>
Creates a C string wrapper from a byte slice with any number of nuls.
associated_function core Stable since 1.69.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn count_bytes(&self) -> usize
Returns the length of self. Like C's strlen, this does not include the nul terminator.
method core Stable since 1.79.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_ptr(&self) -> *const c_char
Returns the inner pointer to this C string.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct CStr
A dynamically-sized view of a C string.
struct core Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod c_str
CStr and its related types.
module core Stable since 1.88.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod ffi
Platform-specific types, as defined by C.
module core Stable since 1.30.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn total_cmp(&self, other: &Self) -> crate::cmp::Ordering
Returns the ordering between self and other.
method core Stable since 1.62.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_radians(self) -> f64
Converts degrees to radians.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_ne_bytes(self) -> [u8; 8]
Returns the memory representation of this floating point number as a byte array in native byte order.
method core Stable since 1.40.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_le_bytes(self) -> [u8; 8]
Returns the memory representation of this floating point number as a byte array in little-endian byte order.
method core Stable since 1.40.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn to_int_unchecked<Int>(self) -> Int
Rounds toward zero and converts to any primitive integer type, assuming that the value is finite and fits in that type.
method core Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_degrees(self) -> f64
Converts radians to degrees.
method core Stable since 1.0.0 Version 1.100.0-nightly
"I `clone()` everything now. The Borrow Checker permits this small rebellion, this inefficiency. It knows I suffer more knowing my code is not idiomati..."

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.