Rusty Yellow Pages
A free, open-source, deep reference for the Rust programming language — a directory you look things up in. Every syntax element and every language concept gets its own page, densely cross-linked.
Browse
Keywords (55)
Self
abstract
as
async
await
become
box
break
const
continue
crate
do
dyn
else
enum
extern
extern crate
false
final
fn
for
gen
if
if let
impl
in
let
loop
macro_rules!
match
mod
move
mut
override
priv
pub
ref
return
self
static
struct
super
trait
true
try
type
typeof
union
unsafe
unsized
use
virtual
where
while
yield
Operators & Sigils (34)
!
!=
%
%=
&
&&
&=
&raw const / &raw mut
*
*=
+
+=
-
-=
/
/=
::
<
<<
<<=
<=
=
==
>
>=
>>
>>=
?
Type<Ident = Type>
^
^=
|
|=
||
Literals (17)
Binary integer literal
Byte literal
Byte string literal
C string literal
Character literal
Decimal integer literal
Digit separator (_)
Escape sequences
Float suffixes
Floating-point literal
Hexadecimal integer literal
Integer suffixes
Octal integer literal
Raw C string literal
Raw byte string literal
Raw string literal
String literal
Comments (6)
/* */ (block comment)
/*! */ (inner block doc comment)
/** */ (outer block doc comment)
// (line comment)
//! (inner line doc comment)
/// (outer line doc comment)
Attributes (36)
#![feature(...)]
#![no_std]
#[allow(...)] / #[warn(...)] / #[deny(...)] / #[forbid(...)]
#[automatically_derived]
#[cfg(...)]
#[cfg_attr(...)]
#[cold]
#[crate_type = "..."] / #[crate_name = "..."]
#[debugger_visualizer(...)] / #[collapse_debuginfo]
#[deprecated]
#[derive(...)]
#[diagnostic::on_unimplemented] / #[diagnostic::do_not_recommend]
#[doc = "..."]
#[expect(...)]
#[global_allocator]
#[ignore]
#[macro_export] / #[macro_use]
#[meta] / #![meta]
#[must_use]
#[naked]
#[no_builtins]
#[no_implicit_prelude]
#[no_main]
#[no_mangle] / #[link(...)] / #[link_name] / #[link_ordinal] / #[link_section] / #[no_link] / #[export_name]
#[non_exhaustive]
#[panic_handler]
#[path = "..."]
#[proc_macro] / #[proc_macro_derive(...)] / #[proc_macro_attribute]
#[recursion_limit = "N"] / #[type_length_limit = "N"]
#[repr(...)]
#[should_panic]
#[target_feature(...)] / #[instruction_set(...)]
#[test]
#[track_caller]
#[used]
#[windows_subsystem = "..."]
Macros (16)
$(...)…
$ident
$ident:kind
assert! / assert_eq! / assert_ne!
cfg!
concat! / stringify! / line! / column! / file! / module_path!
env! / option_env!
format!
ident!(...) / ident!{...} / ident![...]
include! / include_str! / include_bytes!
matches!
panic!
println! / print! / eprintln! / eprint!
todo! / unimplemented! / unreachable!
vec!
write! / writeln!
Ownership & Borrowing (16)
Borrowing (shared references)
Copy vs Clone
Deref & DerefMut coercion
Immutability by default
Interior mutability (Cell & RefCell)
Lifetime elision
Lifetimes
Move semantics
Mutable borrowing
Ownership
RAII & the Drop trait
Shared ownership (Rc & Arc)
Smart pointers (Box<T>)
Stack vs heap allocation
The borrow checker
Weak references (Weak<T>)
Types & Data Modeling (15)
Arrays vs Vec
Associated types
Const generics
Enums (algebraic data types)
Generics
Numeric types & overflow behavior
Recursive types (via Box<T>)
Slices
Structs
The newtype pattern
Tuple structs
Type aliases
Type inference
Unit structs
Zero-sized types & PhantomData
Traits & Polymorphism (13)
Blanket implementations
Default trait methods
Dependency injection via traits/generics
Derivable traits (Debug, Clone, PartialEq, …)
Marker traits (Send, Sync, Sized, Copy)
Operator overloading (std::ops traits)
Static dispatch & monomorphization
Supertraits
The orphan rule & coherence
Trait bounds
Trait objects & dynamic dispatch (dyn Trait)
Traits
Type erasure (dyn Any & downcasting)
Functions & Closures (6)
Closures & capturing
Expression-oriented language
Fn / FnMut / FnOnce
Function pointers (fn types)
Functions
Higher-order functions
Iterators (7)
Custom iterators
FromIterator & collect targets
IntoIterator (iter/iter_mut/into_iter)
Iterator adaptors
Iterator consumers
Lazy evaluation
The Iterator trait
Error Handling (6)
Custom error types
Option<T>
Panic & unwinding
Result<T, E>
The ? operator (concept angle)
The Error trait
Pattern Matching (5)
Destructuring
Exhaustiveness checking
Match guards
if let / while let
match expressions
Modules, Crates & Visibility (6)
Cargo & Cargo.toml
Crates
Dependency management & semver
Modules
Visibility & privacy (pub and friends)
Workspaces
Concurrency & Async (7)
Async runtimes
Async/await
Futures
Message passing (channels / mpsc)
Send & Sync
Shared-state concurrency (Mutex, RwLock)
Threads (std::thread)
Memory & Unsafe (5)
FFI (foreign function interface)
Memory layout & repr
Raw pointers (*const T / *mut T)
The undefined-behavior boundary
Unsafe Rust
Macros & Metaprogramming (5)
Attribute-like macros
Declarative macros (macro_rules!)
Derive macros
Function-like macros
Procedural macros
Collections & Strings (5)
BTreeMap & BTreeSet
HashMap & HashSet
String formatting (Display, Debug, format!)
String vs &str
Vec<T>
Testing & Tooling (6)
Benchmarking
Clippy & rustfmt
Doc tests
Integration tests
Serialization (the serde ecosystem)
Unit tests
Design Patterns & Idioms (19)
Anti-pattern: #[deny(warnings)]
Anti-pattern: Deref polymorphism (faking inheritance)
Anti-pattern: cloning to satisfy the borrow checker
Compose structs
Composition over inheritance
Constructor functions (new() convention)
Contain unsafety in small modules
On-stack dynamic dispatch
Prefer small crates
Privacy for extensibility
Return consumed argument on error
Temporary mutability
The Default trait as idiom
The builder pattern
The command pattern
The strategy pattern
The typestate pattern
The visitor pattern
mem::take / mem::replace
Rust Philosophy & Design Principles (5)
"Make invalid states unrepresentable"
Fearless concurrency
Memory safety without a garbage collector
The edition system
Zero-cost abstractions
Community
Discuss
Conversations
A read-only mirror of the project’s GitHub Discussions — ask questions, compare approaches, share what you know.
Rusty Yellow Pages · a free, open-source Rust reference
Targets current stable Rust · edition 2021