Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn to_string_lossy(&self) -> Cow<'_, str>
Converts a Path to a Cow<str>.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_str(&self) -> Option<&str>
Yields a &str slice if the Path is valid unicode.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_path_buf(&self) -> PathBuf
Converts a Path to an owned PathBuf.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn symlink_metadata(&self) -> io::Result<fs::Metadata>
Queries the metadata about a file without following symlinks.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_prefix<P>(&self, base: P) -> Result<&Path, StripPrefixError>
Returns a path that, when joined onto base, yields self.
method std Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn starts_with<P>(&self, base: P) -> bool
Determines whether base is a prefix of self.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_link(&self) -> io::Result<PathBuf>
Reads a symbolic link, returning the file that the link points to.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_dir(&self) -> io::Result<fs::ReadDir>
Returns an iterator over the entries within a directory.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn parent(&self) -> Option<&Path>
Returns the Path without its final component, if there is one.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new<S>(s: &S) -> &Path
Directly wraps a string slice as a Path slice.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn metadata(&self) -> io::Result<fs::Metadata>
Queries the file system to get information about a file, directory, etc.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn join<P>(&self, path: P) -> PathBuf
Creates an owned PathBuf with path adjoined to self.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn iter(&self) -> Iter<'_>
Produces an iterator over the path's components viewed as OsStr slices.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_symlink(&self) -> bool
Returns true if the path exists on disk and is pointing at a symbolic link.
method std Stable since 1.58.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_relative(&self) -> bool
Returns true if the Path is relative, i.e., not absolute.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_file(&self) -> bool
Returns true if the path exists on disk and is pointing at a regular file.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_empty(&self) -> bool
Checks whether the Path is empty.
method std Stable since 1.98.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_dir(&self) -> bool
Returns true if the path exists on disk and is pointing at a directory.
method std Stable since 1.5.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_absolute(&self) -> bool
Returns true if the Path is absolute, i.e., if it is independent of the current directory.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_path_buf(self: Box<Self>) -> PathBuf
Converts a Box<Path> into a PathBuf without copying or allocating.
method std Stable since 1.20.0 Version 1.100.0-nightly
"I'm pretty sure I'm the only person ever to single handedly write a complex GPU kernel driver that has never had a memory safety kernel panic bug (its..."

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.