CATEGORY
Rust patterns 3,906 crates
Data as of 2026-07-25 (crates.io database dump, timestamp 2026-07-25T02:00:36Z). Source: crates.io · db-dump.tar.gz · methodology & corrections.
exemplarsTrait for providing examples of a type3,157MIT OR Apache-2.0
block_effectsA macro to chain block effects3,152MIT
description-macroimplementation detail of the `description` crate3,151MIT
premortemA configuration library that performs a premortem on your app's config—finding all the ways it would die before it ever runs3,151MIT
yikes-intenumAugment integer-based enums with an unknown variant; a macro that makes you say "yikes!"3,1450BSD
worker-bindingsBindings in wrangler.toml to Rust struct3,143MIT
option-likeCreate your own Option-like enum3,136Apache-2.0 OR MIT
serde-enum-deriveSerde enum primitive derive3,130MIT
yoshi-stdCore, std-only error type for the Yoshi framework.3,129MIT OR Apache-2.0
context_errorLibrary to create rich errors to help users understand what the error was and how to fix it3,129EUPL-1.2
mcurryMacros for creating curried functions.3,122MIT
vesta-syntaxThe syntax for the `case!` macro defined in the Vesta crate3,121MIT
negateAttribute macro that generates negated versions of functions that return booleans.3,115MIT
devela_base_macrosprocedural macros for `devela_base_core`3,112MIT OR Apache-2.0
digenumAn enum variant extractor3,103MIT
intid-allocatorTypes to allocate and free integer ids3,099MIT OR Apache-2.0
esyncThis package contains some useful synchronization primitives3,086MIT OR Apache-2.0
throwing-macrosCreate explicit errors easily with a handy macro3,086MIT OR Apache-2.0
fast-concatFastest macro for concatenating strings.3,086MIT OR Apache-2.0
shakespeareAn actor framework3,079MIT OR Apache-2.0
ascoltAsync runtime-agnostic actor framework3,075non-standard
reaxA reactivity system for Rust that infers dependencies between functions.3,071MIT
hazmatA collection of helpers for working with hazardous materials in Rust crates.3,069MIT OR Apache-2.0
get_set_macroProcedural macro to generate customizable getters and setters in Rust3,062MIT
assert_has_fieldA Rust macro for checking if a struct has a specific field.3,052MIT OR Apache-2.0
struct_deser-deriveMacros 1.1 implementation of #[derive(StructDeser)]3,047MITNFA
possibly_uninitTraits and types helping with using uninitialized memory safely.3,039MITNFA
idealistA library of non-empty wrappers for standard list types.3,038MIT
init_traitA small helper trait to simplify the initialisation of 'indexable' data structures3,036MIT
iter_accumulateAn iterator adaptor that accumulates the elements and yields the current accumulated value for each iteration3,034MIT OR Apache-2.0
matrix_matchMacro to match on two values at the same time3,032MIT OR Apache-2.0
structinatorLibrary for transfering data from iterators to structs3,031Apache-2.0
typed_indexA strongly typed Index that know what it is indexing3,029MIT OR Apache-2.0
assemblistDefine your builder patterns as you use them.3,028MIT
axmacReadable indexing macros for 1-4 dimensional data structures3,021MIT OR Apache-2.0
bidirectional_enumAutomatically generates conversions between an enum type and any other type3,014MIT
generator_extensionsBasic extensions to Generator types to bring parity with Iterators.3,006Apache-2.0 OR MIT
unbox-box"Wait why did I put a `*` in front of that variable yesterday?" - If `var` is a Box, use `var.unbox_ref()` instead of `&*var` for…2,998MIT OR Apache-2.0
premortem-deriveDerive macros for the premortem configuration validation library2,997MIT
infix_macroProvides a macro that generates the neccesary boilerplate to use "*operator*" infix functions.2,987non-standard
collectablesCollectables: Rust crate of collections helpers for BTreeMap, BTreeSet, HashMapSet, etc. By SixArm.com.2,986MIT OR Apache-2.0 OR GPL-2.0-only
ampscasync multi-producer single-consumer channel2,981MIT OR Apache-2.0
list_files_macroA simple proc macro to generate a const list of filenames and optionally apply a macro to each2,981MIT
deep_safe_dropSafe dropping of deep trees that otherwise could cause stack overflow.2,975Unlicense
bointerAssorted pointer-related utilities2,969MIT OR Apache-2.0
pointer-identityWrapper type to treat the pointer address of types as identity rather than the value2,966MIT
tap-traitInspect and mutate values without leaving the method chain2,946MIT
math_captchaThis is a mathematical CAPTCHA code generator written in Rust.2,946MIT
hierrorchyProc macro library to simplify the definition of error hierarchies.2,944MPL-2.0
collections_macrosa collection of macros to make making collections easier2,941MIT OR Apache-2.0
derive-num-boundedMacros for implementing bounded number types2,933MIT
chainerA cursed crate that allows for global call chaining with access to chained function results2,931MIT
overwriteA simple trait that defines how to overwrite a type by another types.
Mainly useful to create an app configuration from different…2,931MIT OR Apache-2.0
derivenummacros intended for use on enums to reduce boilerplate / provide useful shortcuts2,923non-standard
double-dynMacro for implementing functions with multiple dynamic argument dispatch2,923MIT OR Apache-2.0
scope-functionsThis crate provides Kotlin-inspired scope functions for use in almost any situation.2,923MIT
descriptionlike Display, but 'static2,920MIT
const_fixedpA const type for fixed point arithmetic2,913Apache-2.0
ffi-closureSend and recevie closures through FFI2,909MIT
fastpasta_toml_macroDEPRECATED. Development continues at: https://crates.io/crates/descriptive_toml_derive. Convenience crate with a trait definition…2,909MIT OR Apache-2.0
dfdiDependency For Dependency Injection2,908MIT
yoshi-deriveProcedural-macro helpers for deriving Yoshi errors.2,906MIT OR Apache-2.0
quantifiedSpecify the universe: None, Some, Excluding, and All2,896MIT
hash-ofA typesafe wrapper for hashes2,891MIT
libmwLibrary for constructing a pipeline of middleware functions2,890MIT
take_refTakeRef, TakeSlice, and TakeString traits enable treating references/slices and values interchangeably. They can be treated as…2,885MPL-2.0
iter-nA utility for functions returning impl Iterator to return one of several distinct types.2,883MIT OR Apache-2.0
collect-withA utility crate for enhanced collection operations with capacity control.2,882Apache-2.0
unwrap_allUnpack multiple levels of `Result<T, E>` and `Option<T>` at once2,882MIT/Apache-2.0
add-syntaxAttribute macros that prepend or append arbitrary syntax. Useful with `cfg_attr`.2,881Apache-2.0
trait_derive_coreCore implementation for 'trait_derive' crate.2,877MIT
swap-nan n argument extension to std::mem::swap2,869MIT
ref-portalsSafely use (stack) references outside their original scope2,869MIT OR Apache-2.0
try-exitDependency free, simple error handling for small programs2,861WTFPL
file_into_stringfile_into_string: Rust crate of utility functions to read a file into a string, or a vector of strings, and preserving line…2,860MIT OR Apache-2.0 OR GPL-2.0 OR GPL-3.0
wrap_resulteasy to wrap Ok(value) , Err(value) or Some(value)2,859MIT OR Apache-2.0
nagmehighly maintainable, super pedantic linting2,853MIT
newer-type-macroSupport defining newtype wrapper with inheriting trait implementations2,853MIT
explicit-error-exitExplicit concrete Error type to manage errors that end a process/program2,852Apache-2.0
roopertAnother object-oriented toolkit for Rust2,851MIT
quick-buildercompile-time checked builder generator with run-time invariant enforcement2,851MIT
slidSimple labeled IDs2,850MIT OR Apache-2.0
new_flattenedMacro to flatten nested calls of `new`s2,850MIT OR Apache-2.0
onevecOne-based indexed Vec wrapper2,849MIT OR Apache-2.0
pure_cellAlternative to GhostCell that provides safe interior mutability via const expressions.2,843Apache-2.0 OR MIT OR BSL-1.0
threadbeamA simple, specialized channel type for beaming data out of a newly spawned thread2,838MIT OR Apache-2.0
chainedA library for lazily chaining functions2,834MIT
modsSimpler module declaration.2,831MIT OR Apache-2.0
simple-undoEasy to use undo-redo library2,815MIT
partial_derivemakes all the properties of a struct type an optional property2,815MIT
collect_array_ext_traitCollect an iterator into an array.2,812MIT OR Apache-2.0
projectionsMacro-free pin projections because why not?2,812Apache-2.0 OR BSL-1.0 OR MIT
todo_usingA super small crate only exporting a single macro to "use" parameters.2,811MIT OR Apache-2.0
gdnative_export_node_as_pathBoilerplate-code replacement macros when exporting node references through NodePath.2,811non-standard
init-tokenA crate for one-time safe initialization of static, without overhead.2,810MIT
dioptreStruct field projection tools2,804MIT/Apache-2.0
stridImprove and strengthen your strings by making them strongly-typed with less boilerplate2,803Apache-2.0 OR MIT
is_testedHelper attribute for `cargo-is-tested`, along with `is_not_tested`2,802MIT
push_mutPush a value to the back of the vector, and return a mutable reference to it.2,801MIT OR Apache-2.0
derive-attr-parserVery simple parser for proc macro attributes2,798MIT OR Apache-2.0
enjoinPowerful syntax-level async join macro2,798MPL-2.0
displaystrAn attribute macro for ergonomically implementing the Display trait2,793MIT OR Apache-2.0
with-apiSimple macro for shrinking scope2,784MIT OR Apache-2.0
field-projectionField projection experiment2,783Apache-2.0 OR MIT
constant-cstrCreate const instances of CStr at compile time2,780MIT OR Apache-2.0
iter_valsOn the fly iterator creation.2,778MIT OR Apache-2.0
coop_heapReserved. Heap cooperation for **safe** applications & libraries. See https://github.com/coop-rs/co_heap instead.2,778Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
existentialExistential quantification over lifetimes2,774MIT OR Apache-2.0
typestate-builderDerive-macro-based generator that combines `Typestate` and `Builder` patterns.2,771MIT OR Apache-2.0
newer-typeSupport defining newtype wrapper with inheriting trait implementations2,771MIT
x-bowPrecise State Management Library2,767MPL-2.0
tryboxstable, `no_std`-compatible, fallible heap allocation2,766MIT OR Apache-2.0
visualUse Display if available, Debug otherwise2,764MIT
enum-conversion-traitsTraits for converting between enums and the types and their variants.2,764GPL-2.0-or-later
convertableNon-reflexive version of From and Into2,762MIT OR Apache-2.0
stringishA smaller and easier copy-on-write string2,757MIT OR Apache-2.0
dastralReduce boilerplate code, learn data structures & algorithms
with Dastral.2,751MIT
define_into_enumDefines Into<T> on an enum where all variants wrap T.2,751Apache-2.0
transitionableA no_std compatible type to transition `T -> T` where you have an `&mut T`.2,750MIT
result-extExtends `Result` with additional operations2,750MPL-2.0
typology-deriveType derivation for foreign use2,747MIT OR Apache-2.0
cfg_matrixProcedural macro to generate permutations of supertraits based on cfg flags.2,747MIT
flyweightsInterned strings & bytestrings for client-controlled values in long-lived programs.2,740BSD-2-Clause
layer0Protocol traits for composable agentic AI systems2,739MIT OR Apache-2.0
send_cellsSafe and unsafe cells implementing Send/Sync2,738MIT OR Apache-2.0
getargs-osProvides a way for `getargs` to parse OS strings2,731MIT
step-countCount items of an iterator with any Step type.2,727MIT
dolessA Rust macro to simplify struct mapping , injects cache lookup logic directly into your functions ,and function utilities.2,724MIT OR Apache-2.0
turbostateSimple to use Finite State Machine2,718MIT
wx-core微信数据解析工具2,713MPL-2.0
tyenum_attributeAttribute macro for type enums.2,712MIT
refinement-typesRefinement types.2,711MIT
expand_arrayMacro to convert a static array to a fixed-size array2,710MPL-2.0
comfy-print-syncNon-panicking versions of println! and friends. Sync implementation.2,710MIT
try_convertAuto-generate TryFrom and an error type, with minimal boilerplate2,708MIT
saturateRust traits for saturating conversion between numeric types2,706MIT OR Apache-2.0
delegation-codegenCode generation for `delegation` crate.2,706MIT OR Apache-2.0
devela_base_corebase shared functionality for devela2,704MIT OR Apache-2.0
ser_mapperMapped DTO serialzation wrapper for DBO/Model2,700MIT
test_eqassert_eq!-like macros that return a Result instead2,696MIT OR Apache-2.0
valibukValibuk is a library and a set of macros implementing the correct-by-construction pattern.2,693MIT OR Apache-2.0
enum-primitive-derive-nostdenum_primitive implementation using procedural macros to have a custom derive2,689MIT
rewrap`Result<Result<T, E>, F>` -> `Result<T, F>`2,684MIT OR Apache-2.0
unreachable_checkedunreachable!()-like macro that causes linking error instead of panicking. May be used to statically ensure some code won't panic.2,679MITNFA
mathelogosLibrary to make Rust as a functional programming language.2,676Apache-2.0
pipe-chainCombinators & parser library2,673BSD-3-Clause
algtype_deriveMacros for algtype2,670MIT OR Apache-2.0
conditional-assignmentThis is a very simple, small crate to help make conditional assignments more ergonomic.2,669MIT OR Apache-2.0
debug-tagDebug-only tagging for tracking values2,666MIT
borrow-frameworkMore flexible borrowing2,663MIT
known-languagesWell-known languages.2,663Unlicense
dodgemsA simple and fast bump allocator library2,662MIT
srceSelf-Ref Cell Environments2,659MIT OR Apache-2.0
try-nextA minimal synchronous trait for fallible, pull-based item sources.2,659MIT
syn_builderBuilder functions for `syn` structures and enums to ease the generation of Rust code.2,655MIT OR Apache-2.0
compiler-test-deriveA macro to generate easily tests across compilers and engines2,653MIT
fallback-ifFall back to an alternative given some predicate2,653Apache-2.0 OR MIT
tinydynA lightweight dynamic dispatch library2,646Apache-2.0
has-someThe opposite of is_empty (and is_empty for filters)2,643Apache-2.0
qubit-functionFunctional programming traits and Box/Rc/Arc adapters for Rust, inspired by Java functional interfaces2,639Apache-2.0
repr_c_wrapperOpaque `#[repr(C)]` wrapper that can be passed by value over FFI2,637MIT OR Apache-2.0
async-refreshCreate values that refresh automatically and asynchronously after a given duration.2,637MIT
borrow_mutexAsync Rust Mutex which does not require wrapping the target structure2,629MIT
simple-diSimple dependency injection for Rust2,622MIT
generics2Provides macros for parsing generics (with optional where clause) in `macro_rules!` - enhanced fork of generics.2,621MIT OR Apache-2.0
liftorFunctors for Rust lifetimes2,615non-standard
derive_displayA convenient attribute to derive `Display` implementation from another trait implementation. Currently supports
`ToTokens`.2,615MIT
macro_macroMacro templating library for DRYer structs2,613MIT
u32errA neat error type for FFI functions (where non-zero = failure)2,610MIT
relaxedWrappers around Atomics that always use `Ordering::Relaxed`2,606MIT OR Apache-2.0
rustilityA collection of utilities I often find myself using in Rust2,600MIT OR Apache-2.0
bizerrorProvides a standardized approach for defining and managing business-related errors2,600MIT OR Apache-2.0
stronglyA proc macro to create strongly-typed primitives2,598MIT OR Apache-2.0
i2uCommon useful functions, that are Zero cost abstractions using generics, to easily convert numbers to binary, hex, octal, and…2,588MIT OR Apache-2.0
atomiclockA non-blocking lock that can be used in async contexts2,584MIT OR Apache-2.0
throwingCreate explicit errors easily with a handy macro2,580MIT OR Apache-2.0
supply-chain-trust-example-crate-000020Extra iterator adaptors, iterator methods, free functions, and macros.2,577MIT OR Apache-2.0
option_into_controlflowOption into ControlFlow conversion2,566MIT OR Apache-2.0
derive_hash_fastA faster replacement for `#[derive(Hash)]` for types without padding2,558MIT OR Apache-2.0
case_iterableA procedural macro to iterate over enum variants, ala Swift's CaseIterable2,554GPL-3.0
desugar-implSugar for less explicit generics in structs, enums, and union declarations.2,553ISC OR MIT OR Apache-2.0
dupit-derivecopy or clone a value2,551Apache-2.0
enumsEnumerate trait for vector and slice in rust. It abstracts chain methods like .iter().enumerate().collect() into a clean,…2,546MIT
random_stuffA pile of random helpers, macros, extension traits... that I didn't care to write a separate crate for. Probably nothing to do…2,536WTFPL
facet-defaultDerive Default for facet types with custom field defaults2,535MIT OR Apache-2.0
usingA macro for simpler builders with method cascading2,526MIT
patchableAutomatically derive patch types for Rust structs to enable efficient partial updates with zero runtime overhead2,526MIT OR Apache-2.0
let_cloneDeclarative macro to clone multiple values at once2,522MIT OR Apache-2.0
type_at_deriveProvides the #[derive(TypeAt)] proc. macro.2,520MIT/Apache-2.0
try_createA small library providing generic traits for fallible and infallible object creation.2,518MIT OR Apache-2.0
async-rayonMix async code with CPU-heavy thread pools using Futures + Rayon2,500MIT
powerlettersConcise spellings of common Rust operations2,496CC0-1.0 OR MIT OR Apache-2.0
spansSplit an iterator into contiguous spans.2,494MIT OR Apache-2.0
sigmuta state management framework designed to be used as a foundation for UI frameworks.2,490MIT OR Apache-2.0
maybe-borrowMacros for conditionally returning borrowed data.2,489MIT
dummy-allocGlobal allocator that fails all allocations2,487BlueOak-1.0.0
enum_reflect_externTraits for enum_reflect2,483MIT
docposCompact-document items after defining them (fn, struct, enum) + document fn parameters with rustdoc (⑂roxygen)2,483MIT
vestaExtensible pattern matching2,482MIT
supply-chain-trust-example-crate-000022Single assignment cells and lazy values.2,476MIT OR Apache-2.0