Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
Static items StaticItem -> ItemSafety?[^extern-safety] `static` `mut`? IDENTIFIER `:` Type ( `=` Expression )? `;` [^extern-safety]: The safe and unsafe function qualifiers are only allowed semantically within extern blocks. A static item i...
The Rust Reference Book 2024-01-01 ~3 min read
doc.rust-lang.org
Constant items ConstantItem -> `const` ( IDENTIFIER | `_` ) `:` Type ( `=` Expression )? `;` A constant item is an optionally named constant value which is not associated with a specific memory location in the program. Constants are essenti...
The Rust Reference Book 2024-01-01 ~2 min read
doc.rust-lang.org
Unions Union -> `union` IDENTIFIER GenericParams? WhereClause? `{` StructFields? `}` A union declaration uses the same syntax as a struct declaration, except with union in place of struct. A union declaration defines the given name in the t...
The Rust Reference Book 2024-01-01 ~4 min read
doc.rust-lang.org
Enumerations Enumeration -> `enum` IDENTIFIER GenericParams? WhereClause? `{` EnumVariants? `}` EnumVariants -> EnumVariant ( `,` EnumVariant )* `,`? EnumVariant -> OuterAttribute* Visibility? IDENTIFIER ( EnumVariantTuple | EnumVariantStru...
The Rust Reference Book 2024-01-01 ~5 min read
doc.rust-lang.org
Structs Struct -> StructStruct | TupleStruct StructStruct -> `struct` IDENTIFIER GenericParams? WhereClause? ( `{` StructFields? `}` | `;` ) TupleStruct -> `struct` IDENTIFIER GenericParams? `(` TupleFields? `)` WhereClause? `;` StructField...
The Rust Reference Book 2024-01-01 ~1 min read
doc.rust-lang.org
Type aliases TypeAlias -> `type` IDENTIFIER GenericParams? ( `:` Bounds )? WhereClause? ( `=` Type WhereClause?)? `;` A type alias defines a new name for an existing type in the type namespace of the module or block where it is located. Typ...
The Rust Reference Book 2024-01-01 ~1 min read
doc.rust-lang.org
Functions Function -> FunctionQualifiers `fn` IDENTIFIER GenericParams? `(` FunctionParameters? `)` FunctionReturnType? WhereClause? ( BlockExpression | `;` ) FunctionQualifiers -> `const`? `async`?[^async-edition] ItemSafety?[^extern-quali...
The Rust Reference Book 2024-01-01 ~10 min read
doc.rust-lang.org
Use declarations UseDeclaration -> `use` UseTree `;` UseTree -> (SimplePath? `::`)? `*` | (SimplePath? `::`)? `{` (UseTree ( `,` UseTree )* `,`?)? `}` | SimplePath ( `as` ( IDENTIFIER | `_` ) )? A use declaration creates one or more local n...
The Rust Reference Book 2024-01-01 ~10 min read
doc.rust-lang.org
Extern crate declarations ExternCrate -> `extern` `crate` CrateRef AsClause? `;` CrateRef -> IDENTIFIER | `self` AsClause -> `as` ( IDENTIFIER | `_` ) An extern crate declaration specifies a dependency on an external crate. The external cra...
The Rust Reference Book 2024-01-01 ~2 min read
doc.rust-lang.org
Modules Module -> `unsafe`? `mod` IDENTIFIER `;` | `unsafe`? `mod` IDENTIFIER `{` InnerAttribute* Item* `}` A module is a container for zero or more items. A module item is a module, surrounded in braces, named, and prefixed with the keywor...
The Rust Reference Book 2024-01-01 ~3 min read
doc.rust-lang.org
Items Item -> OuterAttribute* ( VisItem | MacroItem ) VisItem -> Visibility? ( Module | ExternCrate | UseDeclaration | Function | TypeAlias | Struct | Enumeration | Union | ConstantItem | StaticItem | Trait | Implementation | ExternBlock )...
The Rust Reference Book 2024-01-01 ~1 min read
doc.rust-lang.org
Conditional compilation ConfigurationPredicate -> ConfigurationOption | ConfigurationAll | ConfigurationAny | ConfigurationNot | `true` | `false` ConfigurationOption -> IDENTIFIER ( `=` ( STRING_LITERAL | RAW_STRING_LITERAL ) )? Configurati...
The Rust Reference Book 2024-01-01 ~9 min read
doc.rust-lang.org
Crates and source files @root Crate -> InnerAttribute* Item* [!NOTE] Although Rust, like any other language, can be implemented by an interpreter as well as a compiler, the only existing implementation is a compiler, and the language has al...
The Rust Reference Book 2024-01-01 ~3 min read
doc.rust-lang.org
Procedural macros Procedural macros allow creating syntax extensions as execution of a function. Procedural macros come in one of three flavors: • Function-like macros - custom!(...) • Derive macros - #[derive(CustomDerive)] • Attribute mac...
The Rust Reference Book 2024-01-01 ~10 min read
doc.rust-lang.org
Macros by example MacroRulesDefinition -> `macro_rules` `!` IDENTIFIER MacroRulesDef MacroRulesDef -> `(` MacroRules `)` `;` | `[` MacroRules `]` `;` | `{` MacroRules `}` MacroRules -> MacroRule ( `;` MacroRule )* `;`? MacroRule -> MacroMat...
The Rust Reference Book 2024-01-01 ~18 min read
doc.rust-lang.org
Macros The functionality and syntax of Rust can be extended with custom definitions called macros. They are given names, and invoked through a consistent syntax: some_extension!(...). There are two ways to define new macros: • Macros by Exa...
The Rust Reference Book 2024-01-01 ~1 min read
doc.rust-lang.org
Tokens Token -> RESERVED_TOKEN | RAW_IDENTIFIER | CHAR_LITERAL | STRING_LITERAL | RAW_STRING_LITERAL | BYTE_LITERAL | BYTE_STRING_LITERAL | RAW_BYTE_STRING_LITERAL | C_STRING_LITERAL | RAW_C_STRING_LITERAL | FLOAT_LITERAL | INTEGER_LITERAL...
The Rust Reference Book 2024-01-01 ~20 min read
doc.rust-lang.org
Whitespace WHITESPACE -> U+0009 // Horizontal tab, `'\t'` | U+000A // Line feed, `'\n'` | U+000B // Vertical tab | U+000C // Form feed | U+000D // Carriage return, `'\r'` | U+0020 // Space, `' '` | U+0085 // Next line | U+200E // Left-to-ri...
The Rust Reference Book 2024-01-01 ~1 min read
doc.rust-lang.org
Comments @root COMMENT -> LINE_COMMENT | INNER_LINE_DOC | OUTER_LINE_DOC | INNER_BLOCK_DOC | OUTER_BLOCK_DOC | BLOCK_COMMENT LINE_COMMENT -> `//` (~[`/` `!` LF] | `//`) ~LF* | `//` EOF | `//` _immediately followed by LF_ BLOCK_COMMENT -> `/...
The Rust Reference Book 2024-01-01 ~2 min read
doc.rust-lang.org
Identifiers IDENTIFIER_OR_KEYWORD -> ( XID_Start | `_` ) XID_Continue* XID_Start -> <`XID_Start` defined by Unicode> XID_Continue -> <`XID_Continue` defined by Unicode> RAW_IDENTIFIER -> `r#` IDENTIFIER_OR_KEYWORD NON_KEYWORD_IDENTIFIER ->...
The Rust Reference Book 2024-01-01 ~1 min read
"I have written in dozens of computer languages, including specialized ones that were internal to Pixar (including one I designed). I spent decades wri..."

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.