What you will learn in Idiomatic Rust
Code like a Rustacean
Chapter by chapter
Concepts explained in this book
- immutable collectionImmutability is the property that existing values or data structures cannot be modified after they are created.
- genericsA generic function is a function defined with type or value parameters so it can operate across multiple parameterizations.
- listA linked list is a sequence of elements in which each element stores a reference or pointer to another element in the sequence.
- design patternA reusable, high-level software design abstraction that provides a familiar template for solving a class of common programming problems.
- stateGlobal data is program state stored in a globally accessible location rather than passed through local interfaces.
- macroA macro is a named construct that expands or transforms source code, commands, or templates before or during execution.
- traitA Rust language feature that defines shared behavior through required or provided methods without requiring a common inheritance hierarchy.
- resource acquisition is initializationResource acquisition is initialization is a resource-management pattern in which acquiring a resource is tied to initializing an object and releasing it to that object's destruction.
- into_iterinto_iter is a method that consumes a collection or other iterable value and returns an iterator that yields its owned elements.
- unsafe RustUnsafe Rust is Rust code that permits operations whose safety conditions the compiler cannot fully verify and that therefore require the programmer to uphold the relevant invariants.
- lifetimeA Rust lifetime is a compile-time property describing how long a reference or borrow remains valid.
- smart pointerA smart pointer is a pointer-like value that manages or mediates access to the data it references.
- iteratorAn iterator is an abstraction that produces a sequence of values one element at a time according to a traversal protocol.
- idiomatic coding styleA conventional low-level coding practice concerning source-code syntax, formatting, naming, or style within a programming language community.
- trait boundA trait bound is a constraint requiring a generic type to implement one or more specified traits.
- antipatternAn antipattern is a commonly recognized programming practice that is harmful or ineffective in particular contexts or circumstances.
- closureA closure is an anonymous function value that can accept parameters and capture values from its surrounding environment.
- iterator structsIterator structs are stateful objects that store traversal state and implement iterator behavior for a collection.
- iteriter is a collection method that returns an iterator over immutable references to the collection's elements without consuming the collection.
- destructorA destructor is cleanup behavior automatically invoked when an object is destroyed.
- initializerA constructor is a conventional method or function that creates and returns a newly initialized value of a type.
- RustRust is a systems programming language designed to provide memory safety and concurrency without relying on garbage collection.
- IntoIteratorIntoIterator is a Rust trait that defines how a value is converted into an iterator, including iteration by ownership or reference.
- iter_mutiter_mut is a collection method that returns an iterator over mutable references to the collection's elements without consuming the collection.
- PhantomDataPhantomData is a Rust standard-library zero-sized marker struct that logically associates a type with a generic parameter or ownership relationship without storing a value of that type.
- trait objectA trait object is a dynamically dispatched Rust value accessed through a trait interface rather than its concrete type.
- refcellRefCell is Rust's single-threaded interior-mutability container that checks borrowing rules at runtime.
- finite-state machineA state machine is a computational model whose behavior changes according to its current state and explicitly defined transitions.
- question mark operatorThe ? operator is a Rust postfix operator that propagates a Result error or an absent Option value by returning early from the enclosing function.
- procedural macroA procedural macro is a Rust macro implemented as code that programmatically transforms a token stream into generated Rust code.
- borrow checkerThe borrow checker is the Rust compiler component that verifies ownership, borrowing, and reference validity at compile time.
- DerefDeref is a Rust trait that defines how a value can be dereferenced to access a target value through the dereference operator.
- blanket implementationA blanket implementation is a trait implementation that applies to every type satisfying specified trait bounds.
- scopeA scope is a region of program text that determines where bindings are valid and when their associated values are destroyed.
- copyThe Rust Clone trait defines explicit duplication of a value through its clone method.
- referenceA raw pointer is a pointer value that can be manipulated and dereferenced without Rust's ordinary ownership and borrowing guarantees.
- marker traitA marker trait is a Rust trait that conveys compile-time information about a type without necessarily defining methods or other behavior.
- result typeResult is Rust's standard-library enum representing either successful output of type T or an error of type E.
- derive macroA derive attribute instructs the Rust compiler to generate implementations for specified traits or other derived functionality.
- pattern matchingPattern matching is a language feature that selects behavior by testing a value against structurally defined patterns and optionally binding parts of the value.
- data transformationmap is an iterator or result-like-type method that applies a function to each available value and returns the transformed result.
- coroutineA coroutine is a function-like computation that can suspend its execution, yield values, and later resume or complete.
- public visibilityVisibility is the language-defined accessibility of a program item from a given scope or module.
- memory leakA memory leak is a failure to release dynamically allocated memory after it is no longer reachable or needed.
- newtype idiomThe newtype pattern defines a distinct type, typically as a tuple struct containing an existing type, to add type information or behavior with minimal encapsulation.
- libraryA library is a packaged collection of reusable software components that other programs can depend on and call.
- declarative macroRust's macro_rules! syntax defines declarative macros by associating input token patterns with expansion templates.
- type stateA type-safe state machine is a state-machine design whose valid states and transitions are enforced by the programming language's type system.
- observer patternThe observer pattern is a behavioral design pattern in which a subject notifies registered observers about events without depending on their concrete implementations.
- macro expansionA macro expansion is the compiler-generated source or language construct produced from a macro invocation.
- macro overloadingMacro overloading is the ability of a macro definition system to accept and distinguish different argument forms.
- token treeA token tree is a recursive syntactic structure containing tokens, sequences of tokens, or nested token trees for macro matching.
- slicingA slice is a dynamically sized view of a contiguous sequence without owning the underlying storage.
- interior mutabilityInterior mutability is a capability that permits mutation through an otherwise shared reference while enforcing access rules through a runtime or specialized checking mechanism.
- exceptionError handling is the practice of detecting, representing, propagating, and responding to failures during program execution.
- commandThe command pattern encapsulates an action as an object or value so its execution can be separated from the receiver and controlled in order or timing.
- unwrapunwrap is a method that extracts the value from a successful result-like type and panics when extraction fails.
- builder patternThe builder pattern is a construction pattern that assembles a complex value through a sequence of configurable operations before producing the final value.
- preludeA prelude module is a Rust module that publicly re-exports commonly used items from a crate.
- mut keywordThe Rust `mut` keyword marks a binding or reference as permitting mutation.
- cargo doccargo doc is Cargo's command for generating documentation for a Rust package and its dependencies.
- doc exampleA doc example is executable code embedded in documentation to illustrate how an API or library is used.
- doc testA doc test is an automatically generated test that compiles and executes an executable code example extracted from Rust documentation.
- inner documentationInner documentation is Rust documentation attached to the next source item using documentation comments beginning with /// .
- outer documentationOuter documentation is Rust documentation attached to the outer scope of a source file or module using documentation comments beginning with //! .
- rustdocrustdoc is Rust's documentation generator that produces reference documentation from Rust source code and documentation comments.
- benchmarkA benchmark is a repeatable performance measurement of a program operation under specified conditions.
- cargo benchcargo bench is a Cargo command that compiles benchmarks in release mode and executes them.
- contiguous memory layoutContiguous memory is a region whose elements occupy adjacent memory addresses.
- Criterion.rsCriterion.rs is a Rust benchmarking library that provides statistically oriented and feature-rich performance measurement.
- data localityData locality is the tendency for a program to access data near recently accessed or related data in memory.
- const genericsA const generic is a Rust generic parameter whose value is a compile-time constant rather than a type.
- fluent interfaceA fluent interface is an API style in which chained method calls express a sequence of operations through return values designed for further chaining.
- referential transparencyReferential transparency is the property that an expression can be replaced by its value without changing program behavior.
- OnceCellOnceCell is a Rust standard-library cell that permits a value to be initialized at most once and then accessed thereafter.
- BoxBox is a Rust standard-library owning pointer that stores a value on the heap and provides indirection.
- moveMove semantics transfer ownership of a value into a new binding or operation rather than copying the value.
- coroutine traitThe Rust Coroutine trait defines the interface and associated behavior for resuming a coroutine and observing its yielded or completed result.
- yieldA yield statement suspends a coroutine and optionally supplies a value to its caller.
- deref coercionDeref coercion is Rust's automatic conversion of a reference to a wrapper value into a reference to its dereference target when resolving method calls and compatible operations.
- trait implementationA trait implementation is a declaration that a Rust type satisfies a trait and provides its required behavior.
- functional, stateless philosophyFunctional programming is a programming paradigm that emphasizes composing computations as functions and minimizing mutable state and side effects.
- anyThe Rust Any trait enables runtime type identification and checked conversion to a concrete type for suitable values.
- downcastingDowncasting is converting a value from a general type to a more specific compatible type, typically subject to runtime validation.
- dynThe dyn keyword marks a Rust type position as containing a dynamically dispatched trait object.
- dynamic dispatchDynamic dispatch is runtime selection of an implementation based on the concrete type behind an interface value.
- orphan ruleRust's orphan rule restricts trait implementations so that an implementation must involve a locally defined trait or type, subject to its coherence rules.
- Sized traitThe Rust Sized trait marks types whose size is known at compile time.
- unsized typeAn unsized type is a Rust type whose size is not known at compile time for direct storage.
- attribute macroAn attribute macro is a procedural macro attached to an existing item that can accept attribute arguments and generate replacement or additional code.
- proc_macroproc_macro is Rust's library for implementing procedural macros and manipulating their input and output token streams.
- quotequote is a Rust library that generates Rust source code from syntax-like interpolation constructs.
- synsyn is a Rust library for parsing source code into syntax-tree representations.
- collectcollect is an iterator method that consumes an iterator and builds a collection from its yielded items.
- lazy evaluationLazy evaluation is an execution strategy that postpones computing an expression until its result is required.
- CowCow is Rust's standard-library copy-on-write smart pointer that can represent either borrowed data or owned data.
- lifetime parameterA named parameter that expresses constraints on the validity duration of references in a type or function.
- marker structA struct, typically with no meaningful data, that marks a type with compile-time information.
- phantom typeA type-system technique that attaches a generic parameter to a type without storing a value of that parameter.
- static lifetimeThe Rust lifetime that lasts for the entire duration of the program.
- destructuring assignmentDestructuring is the decomposition of a compound value into bindings for selected or constituent parts through a pattern.
- guardA match guard is an if condition attached to a pattern that must also be true for the branch to match.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
