Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
Numeric types Integer types The unsigned integer types consist of: Type | Minimum | Maximum -------|---------|------------------- u8 | 0 | 28-1 u16 | 0 | 216-1 u32 | 0 | 232-1 u64 | 0 | 264-1 u128 | 0 | 2128-1 The signed two's complement in...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Boolean type let b: bool = true; The boolean type or bool is a primitive data type that can take on one of two values, called true and false. Values of this type may be created using a literal expression using the keywords true and false co...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Types Every variable, item, and value in a Rust program has a type. The type of a value defines the interpretation of the memory holding it and the operations that may be performed on the value. Built-in types are tightly integrated into th...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Type system
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Patterns Pattern -> `|`? PatternNoTopAlt ( `|` PatternNoTopAlt )* PatternNoTopAlt -> PatternWithoutModernRange | ModernRangePattern PatternWithoutModernRange -> LiteralPattern | IdentifierPattern | WildcardPattern | RestPattern | ReferenceP...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~26 min read
_ expressions UnderscoreExpression -> `_` Underscore expressions, denoted with the symbol _, are used to signify a placeholder in a destructuring assignment. They may only appear in the left-hand side of an assignment. Note that this is dis...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Await expressions AwaitExpression -> Expression `.` `await` An await expression is a syntactic construct for suspending a computation provided by an implementation of std::future::IntoFuture until the given future is ready to produce a valu...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
return expressions ReturnExpression -> `return` Expression? Return expressions are denoted with the keyword return. Evaluating a return expression moves its argument into the designated output location for the current function call, destroy...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
match expressions MatchExpression -> `match` Scrutinee `{` InnerAttribute* MatchArms? `}` Scrutinee -> Expression _except [StructExpression]_ MatchArms -> ( MatchArm `=>` ( ExpressionWithoutBlock `,` | ExpressionWithBlock `,`? ) )* MatchArm...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~6 min read
if expressions IfExpression -> `if` Conditions BlockExpressionNoInnerAttributes (`else` ( BlockExpressionNoInnerAttributes | IfExpression ) )? Conditions -> Expression _except [StructExpression]_ | LetChain LetChain -> LetChainCondition ( `...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~4 min read
Range expressions RangeExpression -> RangeExpr | RangeFromExpr | RangeToExpr | RangeFullExpr | RangeInclusiveExpr | RangeToInclusiveExpr RangeExpr -> Expression `..` Expression RangeFromExpr -> Expression `..` RangeToExpr -> `..` Expression...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Loops and other breakable expressions LoopExpression -> LoopLabel? ( InfiniteLoopExpression | PredicateLoopExpression | IteratorLoopExpression | LabelBlockExpression ) Rust supports four loop expressions: • A loop expression denotes an infi...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~8 min read
Closure expressions ClosureExpression -> `async`?[^cl-async-edition] `move`? ( `||` | `|` ClosureParameters? `|` ) (Expression | `->` TypeNoBounds BlockExpression) ClosureParameters -> ClosureParam (`,` ClosureParam)* `,`? ClosureParam -> O...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Field access expressions FieldExpression -> Expression `.` IDENTIFIER A field expression is a place expression that evaluates to the location of a field of a struct or union. When the operand is mutable, the field expression is also mutable...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Method-call expressions MethodCallExpression -> Expression `.` PathExprSegment `(`CallParams? `)` A method call consists of an expression (the receiver) followed by a single dot, an expression path segment, and a parenthesized expression-li...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Call expressions CallExpression -> Expression `(` CallParams? `)` CallParams -> Expression ( `,` Expression )* `,`? A call expression calls a function. The syntax of a call expression is an expression, called the function operand, followed...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Struct expressions StructExpression -> PathInExpression `{` (StructExprFields | StructBase)? `}` StructExprFields -> StructExprField (`,` StructExprField)* (`,` StructBase | `,`?) StructExprField -> OuterAttribute* ( IDENTIFIER | (IDENTIFIE...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Tuple and tuple indexing expressions Tuple expressions TupleExpression -> `(` TupleElements? `)` TupleElements -> ( Expression `,` )+ Expression? A tuple expression constructs tuple values. The syntax for tuple expressions is a parenthesize...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Array and array index expressions Array expressions ArrayExpression -> `[` ArrayElements? `]` ArrayElements -> Expression ( `,` Expression )* `,`? | Expression `;` Expression Array expressions construct arrays. Array expressions come in two...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Grouped expressions GroupedExpression -> `(` Expression `)` A parenthesized expression wraps a single expression, evaluating to that expression. The syntax for a parenthesized expression is a (, then an expression, called the enclosed opera...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
"You don't declare lifetimes. Lifetimes come from the shape of your code, so to change what the lifetimes are, you must change the shape of the code."

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.