Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn as_ptr(&self) -> *const T
Returns a raw pointer to the object T pointed to by this Weak<T>.
method alloc Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(ptr: *const T) -> Self
Converts a raw pointer previously created by into_raw back into Weak<T>.
associated_function alloc Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(self) -> *const T
Consumes the Weak<T> and turns it into a raw pointer.
method alloc Stable since 1.45.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> Weak<T>
Constructs a new Weak<T>, without allocating any memory. Calling upgrade on the return value always gives None.
associated_function alloc Stable since 1.10.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn ptr_eq(&self, other: &Self) -> bool
Returns true if the two Weaks point to the same allocation similar to ptr::eq, or if both don't point to any allocation (because they were created with Weak::new()). However, this function ignores the metadata of dyn Trait pointers.
method alloc Stable since 1.39.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn strong_count(&self) -> usize
Gets the number of strong (Rc) pointers pointing to this allocation.
method alloc Stable since 1.41.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn upgrade(&self) -> Option<Rc<T, A>>
Attempts to upgrade the Weak pointer to an Rc, delaying dropping of the inner value if successful.
method alloc Stable since 1.4.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn weak_count(&self) -> usize
Gets the number of Weak pointers pointing to this allocation.
method alloc Stable since 1.41.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod slice
Utilities for the slice primitive type.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod str
Utilities for the str primitive type.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_boxed_utf8_unchecked(v: crate::boxed::Box<[u8]>) -> crate::boxed::Box<str>
Converts a boxed slice of bytes to a boxed string slice without checking that the string contains valid UTF-8.
function alloc Stable since 1.20.0 Version 1.100.0-nightly
doc.rust-lang.org
pub mod string
A UTF-8–encoded, growable string.
module alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Drain<'a>
A draining iterator for String.
struct alloc Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_str(&self) -> &str
Returns the remaining (sub)string of this iterator as a slice.
method alloc Stable since 1.55.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct FromUtf16Error
A possible error value when converting a String from a UTF-16 byte slice.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct FromUtf8Error
A possible error value when converting a String from a UTF-8 byte vector.
struct alloc Stable since 1.0.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 String.
method alloc Stable since 1.26.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 String.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_utf8_lossy(self) -> String
Converts the bytes into a String lossily, substituting invalid UTF-8 sequences with replacement characters.
method alloc Stable since 1.100.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn utf8_error(&self) -> Utf8Error
Fetch a Utf8Error to get more details about the conversion failure.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
"The best way to learn Rust is to just `try!` and see what works (or is this to just see what works`?` now?)!"

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.