Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
Operator expressions OperatorExpression -> BorrowExpression | DereferenceExpression | TryPropagationExpression | NegationExpression | ArithmeticOrLogicalExpression | ComparisonExpression | LazyBooleanExpression | TypeCastExpression | Assign...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~28 min read
Block expressions BlockExpression -> `{` InnerAttribute* Statements? `}` BlockExpressionNoInnerAttributes -> `{` Statements? `}` Statements -> Statement+ | Statement+ ExpressionWithoutBlock | ExpressionWithoutBlock A block expression, or bl...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~7 min read
Path expressions PathExpression -> PathInExpression | QualifiedPathInExpression A path used as an expression context denotes either a local variable or an item. Path expressions that resolve to local or static variables are place expression...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Literal expressions LiteralExpression -> CHAR_LITERAL | STRING_LITERAL | RAW_STRING_LITERAL | BYTE_LITERAL | BYTE_STRING_LITERAL | RAW_BYTE_STRING_LITERAL | C_STRING_LITERAL | RAW_C_STRING_LITERAL | INTEGER_LITERAL | FLOAT_LITERAL | `true`...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~12 min read
Expressions Expression -> ExpressionWithoutBlock | ExpressionWithBlock ExpressionWithoutBlock -> OuterAttribute* ExpressionWithoutBlockNoAttrs ExpressionWithoutBlockNoAttrs -> LiteralExpression | PathExpression | OperatorExpression | Groupe...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~9 min read
Statements Statement -> `;` | Item | LetStatement | ExpressionStatement | OuterAttribute* MacroInvocationSemi A statement is a component of a block, which is in turn a component of an outer expression or function. Rust has two kinds of stat...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Statements and expressions Rust is primarily an expression language. This means that most forms of value-producing or effect-causing evaluation are directed by the uniform syntax category of expressions. Each kind of expression can typicall...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Debugger attributes The following attributes are used for enhancing the debugging experience when using third-party debuggers like GDB or WinDbg. The debugger_visualizer attribute The debugger_visualizer attribute can be used to embed a deb...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Type system attributes The following attributes are used for changing how a type can be used. The non_exhaustive attribute The non_exhaustive attribute indicates that a type or variant may have more fields or variants added in the future. I...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~4 min read
Limits The following attributes affect compile-time limits. The recursion_limit attribute The recursion_limit attribute may be applied at the crate level to set the maximum depth for potentially infinitely-recursive compile-time operations...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Code generation attributes The following attributes are used for controlling code generation. The inline attribute The inline attribute suggests whether a copy of the attributed function's code should be placed in the caller rather than gen...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~22 min read
Diagnostic attributes The following attributes are used for controlling or generating diagnostic messages during compilation. Lint check attributes A lint check names a potentially undesirable coding pattern, such as unreachable code or omi...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~17 min read
Derive The derive [attribute][attributes] invokes one or more derive macros, allowing new items to be automatically generated for data structures. You can create derive macros with procedural macros. [!EXAMPLE] The [PartialEq][macro@Partial...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Testing attributes The following attributes are used for specifying functions for performing tests. Compiling a crate in "test" mode enables building the test functions along with a test harness for executing the tests. Enabling the test mo...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Attributes InnerAttribute -> `#` `!` `[` Attr `]` OuterAttribute -> `#` `[` Attr `]` Attr -> SimplePath AttrInput? | `unsafe` `(` SimplePath AttrInput? `)` AttrInput -> DelimTokenTree | `=` Expression An attribute is a general, free-form me...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~7 min read
Associated items AssociatedItem -> OuterAttribute* ( MacroInvocationSemi | ( Visibility? ( TypeAlias | ConstantItem | Function ) ) ) Associated Items are the items declared in traits or defined in implementations. They are called this becau...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~10 min read
Generic parameters GenericParams -> `<` ( GenericParam (`,` GenericParam)* `,`? )? `>` GenericParam -> OuterAttribute* ( LifetimeParam | TypeParam | ConstParam ) LifetimeParam -> Lifetime ( `:` LifetimeBounds )? TypeParam -> IDENTIFIER ( `:...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~7 min read
External blocks ExternBlock -> `unsafe`?[^unsafe-2024] `extern` Abi? `{` InnerAttribute* ExternalItem* `}` ExternalItem -> OuterAttribute* ( MacroInvocationSemi | Visibility? StaticItem | Visibility? Function ) [^unsafe-2024]: Starting with...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~13 min read
Implementations Implementation -> InherentImpl | TraitImpl InherentImpl -> `impl` GenericParams? Type WhereClause? `{` InnerAttribute* AssociatedItem* `}` TraitImpl -> `unsafe`? `impl` GenericParams? `!`? TypePath `for` Type WhereClause? `{...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~6 min read
Traits Trait -> `unsafe`? `trait` IDENTIFIER GenericParams? ( `:` Bounds? )? WhereClause? `{` InnerAttribute* AssociatedItem* `}` A trait describes an abstract interface that types can implement. This interface consists of associated items,...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~8 min read
"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, and research. 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.
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.