Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
fn consume(&mut self, amount: usize)
Marks the given amount of additional bytes from the internal buffer as having been read. Subsequent calls to read only return bytes that have not been marked as read.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub trait BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
trait alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub macro format!
Creates a String using interpolation of runtime expressions.
macro alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn format(args: Arguments<'_>) -> string::String
Takes an Arguments struct and returns the resulting formatted string.
function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod fmt
Utilities for formatting and printing Strings.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn nul_position(&self) -> usize
Returns the position of the nul byte in the slice that caused CString::new to fail.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_vec(self) -> Vec<u8>
Consumes this error, returning the underlying vector of bytes which generated the error in the first place.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct NulError
An error indicating that an interior nul byte was found.
struct alloc Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn utf8_error(&self) -> Utf8Error
Access the underlying UTF-8 error that was the cause of this error.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_cstring(self) -> CString
Consumes this error, returning original CString which generated the error.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct IntoStringError
An error indicating invalid UTF-8 when converting a CString into a String.
struct alloc Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_bytes(self) -> Vec<u8>
Returns the bytes that were attempted to convert to a CString.
method alloc Stable since 1.58.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_bytes(&self) -> &[u8]
Returns a slice of u8s bytes that were attempted to convert to a CString.
method alloc Stable since 1.58.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct FromVecWithNulError
An error indicating that a nul byte was not in the expected position.
struct alloc Stable since 1.64.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn new<T>(t: T) -> Result<CString, NulError>
Creates a new C-compatible string from a container of bytes.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_string(self) -> Result<String, IntoStringError>
Converts the CString into a String if it contains valid UTF-8 data.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(self) -> *mut c_char
Consumes the CString and transfers ownership of the string to a C caller.
method alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_bytes_with_nul(self) -> Vec<u8>
Equivalent to CString::into_bytes() except that the returned vector includes the trailing nul terminator.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_bytes(self) -> Vec<u8>
Consumes the CString and returns the underlying byte buffer.
method alloc Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_boxed_c_str(self) -> Box<CStr>
Converts this CString into a boxed CStr.
method alloc Stable since 1.20.0 Version 1.100.0-nightly
"You might be asking: why did you rewrite \[...\] in Rust? And yeah, I don’t really have a good reason. It’s a hobby project. Like gardening, but w..."

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.