Rustacean
Search
Search
Dark mode
Light mode
Explorer
Home
❯
patterns
Folder: patterns
123 items under this folder.
Jun 21, 2026
Accepting impl Trait vs Generics
rust
impl-trait
generics
api-design
Jun 21, 2026
Adding Error Context
rust
errors
context
diagnostics
Jun 21, 2026
Allocator Choices
rust
performance
allocation
allocator
Jun 21, 2026
Application Errors with anyhow
rust
anyhow
errors
applications
Jun 21, 2026
Arc Mutex Shared State
rust
concurrency
arc
mutex
shared-state
Jun 21, 2026
Arena Allocation
rust
performance
allocation
arenas
Jun 21, 2026
AsRef for Flexible Arguments
rust
asref
borrowing
api-design
Jun 21, 2026
Async Message Passing
rust
async
channels
tokio
Jun 21, 2026
Async Timeouts
rust
async
tokio
timeout
cancellation
Jun 21, 2026
Axum Web Service Playbook
rust
axum
web
http
ecosystem
Jun 21, 2026
Benchmarking with Criterion
rust
performance
benchmarking
criterion
Jun 21, 2026
Borrow for Equivalent Keys
rust
borrow
hashmap
api-design
Jun 21, 2026
Borrowed Parameter APIs
rust
ownership
api-design
borrowing
Jun 21, 2026
Borrowing Strings and Slices
rust
borrowing
strings
slices
Jun 21, 2026
Bounds-Check Elimination
rust
performance
bounds-checks
slices
Jun 21, 2026
Boxed Closure Returns
rust
pattern
closures
trait-objects
Jun 21, 2026
Boxing Errors
rust
errors
boxed-error
trait-objects
Jun 21, 2026
Builder Pattern
rust
builder
constructors
api-design
Jun 21, 2026
Building Strings Efficiently
rust
string
allocation
formatting
performance
Jun 21, 2026
Cache-Friendly Data Layout
rust
performance
cache
layout
memory
Jun 21, 2026
Cancellation-Safe IO
rust
async
tokio
io
cancellation
Jun 21, 2026
Cargo Cross-Compilation Setup
rust
cargo
cross-compilation
targets
tooling
Jun 21, 2026
Catch-All and Wildcard Patterns
rust
patterns
wildcard
match
Jun 21, 2026
Chaining with and_then
rust
std
option
result
and_then
combinators
Jun 21, 2026
Choosing Collection Types
rust
collections
design
data-structures
Jun 21, 2026
Choosing Standard Collections
rust
collections
std
api-design
performance
Jun 21, 2026
Command-Line Parsing
rust
cli
arguments
clap
ecosystem
Jun 21, 2026
Composition over Inheritance
rust
oop
composition
api-design
Jun 21, 2026
Configuration Loading
rust
configuration
config
figment
serde
ecosystem
Jun 21, 2026
Constructor Naming
rust
constructors
naming
api-design
Jun 21, 2026
Conversion Method Prefixes
rust
naming
conversions
api-design
Jun 21, 2026
Converting Option to Result with ok_or
rust
std
option
result
errors
combinators
Jun 21, 2026
Critical Sections in Embedded Rust
rust
embedded
interrupts
synchronization
Jun 21, 2026
Deadlock Avoidance
rust
concurrency
deadlock
locks
Jun 21, 2026
Debugging
rust
debugging
diagnostics
backtrace
ecosystem
Jun 21, 2026
Defaulting with unwrap_or Variants
rust
std
option
result
defaults
combinators
Jun 21, 2026
Deriving Traits on Structs
rust
structs
derive
traits
debug
Jun 21, 2026
Documentation Comments
rust
rustdoc
documentation
comments
Jun 21, 2026
Enforcing Expected cfgs
rust
cfg
lints
check-cfg
Jun 21, 2026
Entry API for Accumulator Maps
rust
collections
entry-api
hashmap
btreemap
Jun 21, 2026
Error Handling with thiserror
rust
thiserror
errors
libraries
Jun 21, 2026
Exporting macro_rules Macros
rust
macros
macro-rules
exports
Jun 21, 2026
FFI Wrapper Types
rust
ffi
unsafe
pattern
Jun 21, 2026
Fallback Chains with or_else
rust
std
option
result
fallback
combinators
Jun 21, 2026
Field Init Shorthand
rust
structs
initialization
idiom
Jun 21, 2026
Filtering Vecs with dedup retain and drain
rust
vec
filtering
drain
dedup
Jun 21, 2026
Flamegraph and perf Workflow
rust
performance
profiling
perf
flamegraph
Jun 21, 2026
From and Into
rust
from
into
conversions
api-design
Jun 21, 2026
Heapless Collections in Embedded Rust
rust
embedded
no-std
collections
Jun 21, 2026
Implementing Display by Hand
rust
std
fmt
display
traits
Jun 21, 2026
Inspecting rustc Configuration
rust
rustc
diagnostics
targets
Jun 21, 2026
Iterating Collections
rust
collections
iterators
loops
Jun 21, 2026
Itertools Iterator Helpers Playbook
rust
itertools
iterators
collections
ecosystem
Jun 21, 2026
Keep Application Logic Testable
rust
testing
cli
cargo
design
Jun 21, 2026
LTO and codegen-units
rust
performance
cargo
lto
codegen
Jun 21, 2026
Lending Iterators with GATs
rust
gat
iterators
lifetimes
pattern
Jun 21, 2026
Library and Binary Package Layout
rust
binary-crate
library-crate
package-layout
Jun 21, 2026
LocalSet and Non-Send Futures
rust
async
tokio
send
localset
Jun 21, 2026
Locking Stdin and Stdout
rust
std
io
stdin
stdout
locking
cli
Jun 21, 2026
Making Invalid States Unrepresentable
rust
invariants
types
api-design
Jun 21, 2026
Mapping Present Values with map
rust
std
option
result
map
combinators
Jun 21, 2026
Migrating Editions
rust
editions
migration
cargo-fix
Jun 21, 2026
Minimizing Dependencies
rust
cargo
dependencies
supply-chain
Jun 21, 2026
Move Closures with Threads
rust
concurrency
threads
closures
Jun 21, 2026
Mutex Poisoning and Recovery
rust
concurrency
mutex
poisoning
recovery
panic
Jun 21, 2026
Naming Conventions (Rust API Guidelines)
rust
naming
api-guidelines
api-design
Jun 21, 2026
Newtype Pattern
rust
pattern
newtype
traits
Jun 21, 2026
Phantom Type Parameters
rust
phantom-types
marker-types
typestate
pattern
Jun 21, 2026
Pin projection
rust
unsafe
pin
projection
async
Jun 21, 2026
Predicate Checks with is_some_and and matches
rust
std
option
result
predicates
matches
combinators
Jun 21, 2026
Prefer Iterator Pipelines to Manual Indexing
rust
iterators
performance
idiom
Jun 21, 2026
Procedural Macro Crate Structure
rust
macros
procedural-macros
cargo
crate-structure
Jun 21, 2026
Propagating Errors
rust
errors
propagation
result
Jun 21, 2026
Question Mark with Option
rust
std
option
question-mark
combinators
Jun 21, 2026
Rayon Data Parallelism Playbook
rust
rayon
parallelism
performance
ecosystem
Jun 21, 2026
Re-exporting with pub use
rust
pub-use
re-export
api-design
Jun 21, 2026
Reading Standard Input
rust
std
io
stdin
cli
Jun 21, 2026
Reducing Heap Allocations
rust
performance
allocation
collections
Jun 21, 2026
Regex Text Matching Playbook
rust
regex
text
parsing
ecosystem
Jun 21, 2026
Reqwest HTTP Client Playbook
rust
reqwest
http
async
ecosystem
Jun 21, 2026
Result Returning Tests
rust
testing
result
Jun 21, 2026
Result Type Aliases
rust
pattern
result
aliases
errors
Jun 21, 2026
Return Iterators Instead of Collecting
rust
iterators
api-design
lazy
Jun 21, 2026
Returning Result from main
rust
main
result
cli
Jun 21, 2026
SAFETY Comments
rust
unsafe
documentation
pattern
Jun 21, 2026
Safe Abstractions over Unsafe Code
rust
unsafe
api
pattern
Jun 21, 2026
Scoping Non-Send Values Before Await
rust
async
send
tokio
Jun 21, 2026
Sealed Traits
rust
traits
sealed-traits
api-design
Jun 21, 2026
Serde Data Format Playbook
rust
serde
serialization
json
ecosystem
Jun 21, 2026
SmallVec for Inline Storage
rust
performance
allocation
smallvec
Jun 21, 2026
Snapshot Testing
rust
testing
snapshots
regression
Jun 21, 2026
Sorting and Binary Search on Slices
rust
slices
sorting
search
ordering
Jun 21, 2026
Splitting Strings Without Collecting
rust
string
str
iterators
parsing
Jun 21, 2026
Start Projects with cargo new
rust
cargo
project-structure
getting-started
Jun 21, 2026
Static Dispatch with Generics
rust
generics
traits
dispatch
Jun 21, 2026
Struct Update Syntax
rust
structs
initialization
update-syntax
Jun 21, 2026
Structured Task Sets with JoinSet
rust
async
tokio
tasks
Jun 21, 2026
Target-Specific cfg Boundaries
rust
cfg
targets
portability
conditional-compilation
Jun 21, 2026
Test Organization
rust
testing
organization
Jun 21, 2026
Test-Driven Development in Rust
rust
testing
tdd
Jun 21, 2026
Testable Documentation Examples
rust
documentation
doctest
examples
Jun 21, 2026
Testing Macros with trybuild
rust
macros
testing
trybuild
diagnostics
Jun 21, 2026
The Entry API
rust
collections
hashmap
entry
Jun 21, 2026
The State Pattern
rust
oop
state-pattern
trait-objects
Jun 21, 2026
Tokio Runtime Playbook
rust
tokio
async
runtime
ecosystem
Jun 21, 2026
Tracing and Structured Logging Playbook
rust
tracing
logging
observability
ecosystem
Jun 21, 2026
TryFrom and TryInto
rust
tryfrom
tryinto
conversions
api-design
Jun 21, 2026
Type-State Pattern
rust
typestate
generics
api-design
Jun 21, 2026
Type-State State Machines
rust
typestate
state-machines
oop
Jun 21, 2026
Use a Newtype to Implement Foreign Traits
rust
traits
newtype
orphan-rule
Jun 21, 2026
Use cargo check While Editing
rust
cargo
feedback-loop
tooling
Jun 21, 2026
Using chunks windows and split_at
rust
slices
chunks
windows
split_at
Jun 21, 2026
Weak Back References
rust
weak
rc
pattern
smart-pointers
Jun 21, 2026
Workspace Dependency Inheritance
rust
cargo
workspace
dependencies
manifests
Jun 21, 2026
Workspace Project Structure
rust
workspaces
project-structure
cargo
Jun 21, 2026
Writing Standard Output
rust
std
io
stdout
formatting
cli
Jun 21, 2026
cargo publish, yank and owners
rust
cargo
publishing
crates-io
release
Jun 21, 2026
cargo-audit and cargo-deny
rust
cargo
security
supply-chain
Jun 21, 2026
clap Command Line Playbook
rust
clap
cli
arguments
ecosystem
Jun 21, 2026
if let
rust
if-let
patterns
option
Jun 21, 2026
let else
rust
let-else
patterns
early-return
Jun 21, 2026
spawn_blocking
rust
async
tokio
blocking
Jun 21, 2026
try_reserve and Fallible Allocation
rust
collections
allocation
errors