Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn to_str(&self) -> Option<&str>
Yields a &str slice if the OsStr is valid Unicode.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_os_string(&self) -> OsString
Copies the slice into an owned OsString.
method std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_ascii_uppercase(&self) -> OsString
Returns a copy of this string where each character is mapped to its ASCII upper case equivalent.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn to_ascii_lowercase(&self) -> OsString
Returns a copy of this string where each character is mapped to its ASCII lower case equivalent.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new<S>(s: &S) -> &OsStr
Coerces into an OsStr slice.
associated_function std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn make_ascii_uppercase(&mut self)
Converts this string to its ASCII upper case equivalent in-place.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn make_ascii_lowercase(&mut self)
Converts this string to its ASCII lower case equivalent in-place.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn len(&self) -> usize
Returns the length of this OsStr.
method std Stable since 1.9.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_empty(&self) -> bool
Checks whether the OsStr is empty.
method std Stable since 1.9.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_ascii(&self) -> bool
Checks if all characters in this string are within the ASCII range.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_os_string(self: Box<Self>) -> OsString
Converts a Box<OsStr> into an OsString without copying or allocating.
method std Stable since 1.20.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_encoded_bytes_unchecked(bytes: &[u8]) -> &Self
Converts a slice of bytes to an OS string slice without checking that the string contains valid OsStr-encoded data.
associated_function std Stable since 1.74.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn eq_ignore_ascii_case<S>(&self, other: S) -> bool
Checks that two strings are an ASCII case-insensitive match.
method std Stable since 1.53.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn display(&self) -> Display<'_>
Returns an object that implements Display for safely printing an OsStr that may contain non-Unicode data. This may perform lossy conversion, depending on the platform. If you would like an implementation which escapes the OsStr please use Debug instead.
method std Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_encoded_bytes(&self) -> &[u8]
Converts an OS string slice to a byte slice. To convert the byte slice back into an OS string slice, use the OsStr::from_encoded_bytes_unchecked function.
method std Stable since 1.74.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct OsStr
Borrowed reference to an OS string (see OsString).
struct std Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Display<'a>
Helper struct for safely printing an OsStr with format! and {}.
struct std Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod os_str
The OsStr and OsString types and associated utilities.
module std Stable since 1.87.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod c_str
CStr, CString, and related types.
module std Stable since 1.88.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod ffi
Utilities related to FFI bindings.
module std Stable since 1.0.0 Version 1.100.0-nightly
"(…) as much as i dislike the [cargo-geiger](https://crates.io/crates/cargo-geiger) concept, the name … kind of works `unsafe` is a lot like urani..."

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.