Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn set_extension<S>(&mut self, extension: S) -> bool
Updates self.extension to Some(extension) or to None if extension is empty.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn reserve_exact(&mut self, additional: usize)
Invokes reserve_exact on the underlying instance of OsString.
method std Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn reserve(&mut self, additional: usize)
Invokes reserve on the underlying instance of OsString.
method std Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn push<P>(&mut self, path: P)
Extends self with path.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn pop(&mut self) -> bool
Truncates self to self.parent.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> PathBuf
Allocates an empty PathBuf.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn leak<'a>(self) -> &'a mut Path
Consumes and leaks the PathBuf, returning a mutable reference to the contents, &'a mut Path.
method std Stable since 1.89.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_string(self) -> Result<String, PathBuf>
Converts the PathBuf into a String if it contains valid Unicode data.
method std Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_os_string(self) -> OsString
Consumes the PathBuf, yielding its internal OsString storage.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_boxed_path(self) -> Box<Path>
Converts this PathBuf into a boxed Path.
method std Stable since 1.20.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Invokes clear on the underlying instance of OsString.
method std Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn capacity(&self) -> usize
Invokes capacity on the underlying instance of OsString.
method std Stable since 1.44.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_path(&self) -> &Path
Coerces to a Path slice.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_mut_os_string(&mut self) -> &mut OsString
Yields a mutable reference to the underlying OsString instance.
method std Stable since 1.70.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn add_extension<S>(&mut self, extension: S) -> bool
Append self.extension with extension.
method std Stable since 1.91.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct PathBuf
An owned, mutable path (akin to String).
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn with_file_name<S>(&self, file_name: S) -> PathBuf
Creates an owned PathBuf like self but with the given file name.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn with_extension<S>(&self, extension: S) -> PathBuf
Creates an owned PathBuf like self but with the given extension.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn with_added_extension<S>(&self, extension: S) -> PathBuf
Creates an owned PathBuf like self but with the extension added.
method std Stable since 1.91.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_exists(&self) -> io::Result<bool>
Returns Ok(true) if the path points at an existing entity.
method std Stable since 1.63.0 Version 1.100.0-nightly
"BurntSushi is a super experienced programmer who always seems to know what’s right Shepmaster occasionally pops up to keep things level, and provid..."

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.