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.
pagesA dynamically-sized heap-backed data page. Comprises a user-chosen header and data array packed into a single allocation.4,058Apache-2.0 WITH LLVM-exception
downcast-traitAllow casting between traits.4,058MIT OR Apache-2.0
drop_some`.drop_some` syntax sugar for `Option`. It's instead of `.map(|_|())`.4,056MIT
crabbakeTrait that lets structs represent themselves as (const) Rust expressions4,038non-standard
supplyProvider API for arbitrary number of lifetimes.4,035MIT OR Apache-2.0
duckLike `Iterator::peekable`, but can be stacked an arbitrary number of times.4,034MIT/Apache-2.0
geologicMathematical and geometrical abstractions with a focus on ergonomics.4,027MIT
st_ring_bufferA fixed-size String implementation using a ring buffer4,024MIT OR Apache-2.0
fn_onceThis library provides a convenient derive macro for a once function.4,022MIT OR Apache-2.0
wurmNon-fatal, strongly typed errors4,018MIT
proc_static_assertions_nextCompile-time assertions via procedural macros.4,017MIT OR Apache-2.0
type-state-builderType-state builder pattern derive macro with compile-time safety and enhanced ergonomics.4,011MIT OR Apache-2.0
fused_errorA simple library for working with composable errors.4,007MIT OR Apache-2.0
heredomTuple notations to describe XML-like trees.3,996MIT/Apache-2.0
fancy-ipFanciest way to initialize IP addresses3,993MIT
state-departmentAn implementation of state management and dependency injection in Rust3,988MIT OR Apache-2.0
into-staticUpgrading to static lifetimes.3,985MIT
cuisiner_deriveDerive macros to support cuisiner3,982MIT OR Apache-2.0
ndmathTraits for doing vector geometry operations using built-in types3,981Unlicense
easy-convCut down on trivial `impl From<A> for B` boilerplate code3,977MIT
regecs-codegenCode generation macros for REGECS3,975BSD-3-Clause
materiallyA macro for material implication3,975MIT OR Apache-2.0
splitbitsConcise bit field extraction3,973BSD-3-Clause
atomr-macrosProcedural macros for atomr — `#[derive(Actor)]`, `props!`, `#[derive(Receive)]`.3,969Apache-2.0
named_fnCreate typed functions that can be added as generics3,958MIT
multiple_errorsPropagate multiple errors instead of just the first one3,958MIT OR Apache-2.0
cisnessRuntime 'live witness' of two types being the same3,956MPL-2.0
jni-mangleMangle Rust functions for use with JNI3,952GPL-3.0
forward-methodsA derive macro for forwarding methods from composed objects3,950non-standard
lithiumLightweight exceptions3,949Apache-2.0 OR MIT
macron-collectionsCreates a new instance of std collections: HashMap, HashSet, BTreeMap, BTreeSet, VecDeque, LinkedList and BinaryHeap3,949MIT
match-commutativeMatch on patterns commutatively, reducing the use of duplicated patterns. ↔️3,941MIT OR Apache-2.0
c8strString types that are both utf-8 and null terminated3,940Zlib OR MIT OR Apache-2.0
comp-cat-rsComputational category theory in Rust: all constructions as Kan extensions3,933MIT
fast_escapeSimple, fast escaping of characters.3,931MITNFA
ax-lazyinitInitialize a static value lazily.3,928Apache-2.0
rc_bumpAn arena for heterogeneous types and without lifetimes3,921MIT OR Apache-2.0
maybe-owned-traitEither an owned or borrowed value, with type known at compile time.3,920MIT OR Apache-2.0
system-mimallocUse the system's shared mimalloc library as allocator3,912MIT OR MIT-0
romapA trait for read-only-maps3,904MIT OR Apache-2.0
presence-rsA Rust library providing a tri-state type for representing value presence in schemas and data structures.3,890MIT
intid-deriveProcedural macros for the intid crate (prefer re-exports in intid)3,887MIT OR Apache-2.0
repr-traitTraits to represent Rust reprs3,886MIT
ret_ty_attrSpecify the return type depending on configuration conditional checks.3,886MIT OR Apache-2.0
lorustModern Rust utility library delivering modularity, performance & extras; or simply Rust version of Lodash3,884MIT OR Apache-2.0
offset-vecPacker for Vec and String etc, for all methods index add a offset3,881MIT
error-treesFail with multiple errors, istead of only the first.3,877MIT
lockstepAn iterator adaptor for selective zipping3,876MIT OR Apache-2.0
proto_rsRust-first gRPC macros collection for .proto/protobufs managment and more3,868MIT OR Apache-2.0
fmtyComposable `core::fmt` utilities.3,868MIT OR Apache-2.0
empty-optionConvenient wrappers for taking/replacing values from mutable references to `Option`s and enforcing invariants.3,868MIT/Apache-2.0
macron-mapThe key-value collection parser3,863MIT
sw-errorsA library for error parsing and pretty-printing, used across the swtools toolset.3,862Apache-2.0
rs_envflag_macrosAn easy way to define flags by environment variables3,862non-standard
result_optionAn enum combining Result and Option into a single type.3,860MIT
enumericnumeric range enum variant generation3,856MIT
serde_builderserde extension to build de/serialization algorithms for types using a builder pattern3,855MIT
marker_traitImplement a blanket implementation for a marker trait.3,853Apache-2.0
borrow_channelA channel for borrows3,844MIT OR Apache-2.0
rich-resultRich result type differentiating between recoverable & fatal errors3,842CC0-1.0
inline-procInline procedural macros3,833MIT OR Apache-2.0
vru-cancelCancel tokio stream3,830MIT
typestate-builder-macroDerive-macro-based generator that combines `Typestate` and `Builder` patterns.3,813MIT OR Apache-2.0
tuple_lengthLibrary for determining the length of a tuple.3,812GPL-3.0-or-later
safeA `#[safe]` attribute for explaining why `unsafe { ... }` is OK.3,808MIT OR Apache-2.0
he_di_internalsCommon code for he_di crates3,807MIT/Apache-2.0
type-handleRegular and reference-counted type handles3,791Unlicense
disownDrop ownership via a method.3,788MIT
snaptestDead simple snapshot testing3,785MIT/Apache-2.0
orion-error-deriveDerive macros for orion-error3,776MIT
seesaw-macrosgenerate traits from C header files3,768Apache-2.0 OR MIT
wasm_safe_mutexA suite of WebAssembly-safe synchronization primitives that paper over platform-specific locking constraints.3,759MIT OR Apache-2.0
bointer-deriveAssorted pointer-related utilities (derive macro)3,756MIT OR Apache-2.0
orx-pseudo-default-deriveDerives the PseudoDefault trait that allows to create a cheap default instance of a type, which does not claim to be useful.3,747MIT OR Apache-2.0
sixarm_collectionsCollections for HashMapToSet and BTreeMapToSet as trait extensions. By SixArm.com.3,740MIT OR Apache-2.0 OR GPL-2.0-only
allow_prefixedImplementation of 'allow' crate, exported with no prefix (for prefixless lints), and with clippy_ and rustoc_ prefixes.3,737MIT OR Apache-2.0
once-fncache the result of a function, make it runs only once3,736MIT
cuisinerCook up some conversions to and from C-style binary layouts.3,733MIT OR Apache-2.0
valibuk_coreInternal library of Valibuk3,733MIT OR Apache-2.0
iter-flowFunctional programming utilities for Rust3,728Apache-2.0
io_errserializable `std::io::Error` with improved ergonomics3,724MIT
ignorableStandard library derives that can ignore individual fields3,720MIT OR Apache-2.0
enum-codederive(Code) simplifies error handling by providing an easy-to-use enumeration of error codes3,715MIT
total_float_wrapFloating point wrapper implementing Hash and Ord according to IEEE 754 totalOrd.3,711MIT OR Apache-2.0
varianteStatically-verified enum variant names as strings.3,708MIT OR Apache-2.0
safe-gcA garbage collection library with zero `unsafe` code and zero dependencies.3,698MIT OR Apache-2.0
boring-deriveDerive macros for some common patterns3,696MIT
hazmat-macrosProcedural macros for working with hazardous materials in Rust crates.3,691MIT OR Apache-2.0
thiserror_string_context_macroMacro crate for thiserror_string_context3,684MIT OR Apache-2.0
tinytestWrite more compact unit tests with a small macro.3,669MIT
genies_k8s整合DDD与Dapr 的 k8s 库3,664MIT/Apache-2.0
containsA Container trait3,661MIT
itertools-wildExtra wild iterator adaptors, wild iterator methods, wild free functions, and wild macros.3,661MIT/Apache-2.0
dioptre-deriveCustom derive macro for #[derive(Fields)]3,657MIT/Apache-2.0
struct_deserSimple (de)serialization of structs from/to bytes.3,656MITNFA
yukon_deriveDerive macro generating an impl of the trait Claim.3,644MIT OR Apache-2.0
thenbool::then functions but named properly3,632MIT OR Apache-2.0
lighterMacro for rewriting string matches as tries3,630CC0-1.0
valust-axumValust utilities for Axum3,620MIT OR Apache-2.0
macro_loopA macro for writing repetitive Rust code using loops, conditionals, and bindings3,619MIT OR Apache-2.0
alsoA collection of Kotlin-esque blanket impl helper functions, enabling easier function chaining patterns.3,616MIT
same-typesEnsure that two types are the same.3,611ISC OR MIT OR Apache-2.0
squeakLibrary providing types allowing execution of callbacks in response to values being broadcast or mutated.3,596MIT OR Apache-2.0
vtid-procProcedural macro implementation for vtid - volatile type ID generation3,593MIT OR Apache-2.0
shared-containerA unified abstraction for shared data access in both multi-threaded and single-threaded environments3,591MIT
syllogism-macroUtilities to allow for some specialization using stable Rust.3,588MIT OR Apache-2.0
roopert_macro_rootAnother object-oriented toolkit for Rust (macro)3,586MIT
vvariadics_pleaseImplement things as if rust had variadics3,584MIT OR Apache-2.0
niloeclAn implementation of the axum handler pattern for twilight interactions3,579MIT OR Apache-2.0
name_servername_server3,578MIT/Apache-2.0
merg_deriveDerive macro for the merg::Merge trait3,566non-standard
macron-regexCreates a new instance of Regex3,558MIT
barexpA Rust library that automatically generates mod.rs files for your project3,551MIT
enum_futureA simple macro for creating `Future`-implementing enums containing futures.3,540MITNFA
min-specializationExperimental implementation of specialization3,540MIT
trait-enumizerProc macro to automatically generate enum based on method signatures (with appropriate helpers)3,532MIT/Apache-2.0
libsugarlibsugar provides syntactic sugar in the form of a library3,532MIT
himarkFor those who crave more ergonomic marker traits3,532MIT
intidDefines the IntegerId trait3,527MIT OR Apache-2.0
lox_utilsGeneral helpers used by Lox3,525MIT
noshipNoship is a macro that acts similar as todo! but will throw a compilation error when compiled on release profile.3,520MIT OR Apache-2.0
transaction-stmtransaction abstraction of stm3,514MIT
bulksAmazing bulks! They are like iterators, but in bulk, and therefore support collection into arrays.3,512MIT
temporariesMake temporary values useable in a fairly normal style through macros. This nicely wraps the hacks that work around temporaries’…3,512MIT OR Apache-2.0
dfdi-coreThe core components of dfdi3,511MIT
arraygen-docfixDerive macro for generating arrays from struct fields.3,510MIT
ogre-stream-ext`futures` shortcuts with ergonomic extensions to unlock the full power of Streams in Rust3,510Unlicense
dfdi-macrosMacros for dfdi3,505MIT
upgetSuper simple trait that patterns the value "updae" and "get".3,501MIT OR Apache-2.0
atomic_non_nullAn atomic wrapper around NonNull3,492non-standard
for_build_rsSimple lexer for Rust's build.rs3,489non-standard
cargo-create-protocols-pluginA Rust cargo subcommand that will create initial library code for the protocols crate.3,486MIT/Apache-2.0
vectreeVector-buffered tree collection with pre-/post-order, depth-first, mutable/immutable iterator3,484MIT OR Apache-2.0
nevermoreDerive macros for the bottom type core::convert::Infallible3,482MIT OR Apache-2.0
anon_enumEnum types with fully-generic variants3,475CC0-1.0
atomic_macroAttribute macros for generating AtomicXXX3,469non-standard
valibuk_deriveMacros for the Valibuk library3,447MIT OR Apache-2.0
lmnkjgkj-std-backtrace-anyhowFork of anyhow that uses backtrace from std3,447MIT OR Apache-2.0
async-anyhow-loggerAn easy crate for catching anyhow errors from an asynchronous function, and passing them to your logger3,441MIT OR Apache-2.0
atomiqConvenient tool for atomics in Rust.3,440MPL-2.0
hazA thin abstraction over polymorphic environments3,439MIT
fastpasta_toml_macro_deriveDEPRECATED. Development continues at: https://crates.io/crates/descriptive_toml_derive. Procedural derive macro for serializing a…3,431MIT OR Apache-2.0
anyhow-locanyhow with location3,430MIT
yukonProvides trait for the ability to cheaply duplicate an object.3,430MIT OR Apache-2.0
yield-returnImplement a coroutine like C#'s `yield return` using Rust's `async`, `await`.3,427MIT OR Apache-2.0
sovran-typemapA thread-safe heterogeneous container with type-safety3,422MIT
pbt-macroProperty-based testing with `#![no_std]` compatibility, automatic edge cases, and exhaustive breadth-first search over arbitrary…3,421MPL-2.0
makeitCompile-time checked Builder pattern `derive` macro with zero-memory overhead3,417MIT
vtidA Rust library for generating volatile type IDs3,413MIT OR Apache-2.0
exunHandle unexpected errors3,4090BSD
pattern_codeGiven a path patterm matched source code.3,406MIT
yadiYet Another Dependency Injection framework for writing applications with Rust programming language.3,398MIT OR Apache-2.0
genies_cache整合DDD与Dapr 的 cache 库3,395MIT/Apache-2.0
prost-uuidProstUuid new-type wrapper around uuid::Uuid with prost::Message implemented for it.3,391MIT OR Apache-2.0
try-iteratorAdds a few fallible methods to iterators.3,389MIT
deallocate-zeroedAn extension trait for allocators to deallocate already-zeroed memory.3,386MIT OR Apache-2.0
default-conversionA derive macro to automatic implement conversions between similar structs3,378MIT/Apache-2.0
snarcSendable Non-Atomically Reference Counted3,375MIT
visiting_refContainer types that asynchronously return ownership of a value to another context upon exiting scope3,371MIT/Apache-2.0
fast-concat-macroProcedural macro for fast-concat.3,370MIT OR Apache-2.0
sendptrConvenient cross-thread raw pointer usage / 方便跨线程用裸指针3,366MulanPSL-2.0
inline-modInline modules at macro expansion time3,363MIT
splopHelper functions to determine the first/last repetition of something.3,359MIT/Apache-2.0
type-constType-level associated consts3,344MIT
nnn-macrosGenerate your newtypes from a single macro.3,341WTFPL
bornReuse fields from Struct and Enum definition with functional macros.3,336MIT OR Apache-2.0
mixed_arrayConstruct arrays of mixed types.3,336MIT OR Apache-2.0
vec-resize-no-initResize Vec<u8, u16, u32...> with no initialization.3,331MIT
genies_ddd整合DDD与Dapr 的 dd 库3,328MIT/Apache-2.0
mergMerge multiple values into one3,327non-standard
shared_channelMulti-producer, multi-consumer FIFO queue communication primitives.3,325MIT
fatal-errorDifferentiate errors and fatal errors3,322BSD-3-Clause
non-empty-iterNon-empty iterators.3,317MIT
macron-pathCreates a new instance of PathBuf3,312MIT
nodynEasy polymorphism with enums3,311MIT
non-zero-sizeNon-zero sizes.3,305MIT
extdotA set of macros for testing the extended dot notation3,304MIT OR Apache-2.0
home-preludePrelude library to support home applications3,286MIT
clap-docCreate markdown descriptions for `clap::Command`s3,283Apache-2.0 OR MIT
errorconA small crate for scoping errors and easier error conversion3,280Apache-2.0
binderA simple, zero-dependency property-binding framework.3,280MIT
maybe_nullA pointer type for handling potentially null values without accidental dereference3,274non-standard
genies_dapr整合DDD与Dapr 的 dapr 库3,271MIT/Apache-2.0
disjoint-borrowDisjoint mutable borrows of slices3,270MIT
goofy-animalsGenerate a name in adjective-adjective-animal form3,262MPL-2.0
apply_conditionallyChain and apply methods on objects conditionally.3,256MIT
derail-macrosProcedural macros for the `derail` crate.3,246MIT OR Apache-2.0
pawnAn unchecked borrow-like operation for Cells.3,245MIT
hypermodAutomatically build the module tree from the src/ dir.3,240MIT OR Apache-2.0
achanA simple & convenient representation for any value3,240MPL-2.0
ord_byConveniently attach a custom compare function to any type3,235MIT OR Apache-2.0
map-selfMap a value itself instead of its contained value in usual closure style3,214MIT OR Apache-2.0
delegationMacro-based delegation for enums and structs.3,211MIT OR Apache-2.0
code-tourEnhanced example-based learning, i.e. awesome examples user experience3,208BSD-3-Clause
dupitcopy or clone a value3,204Apache-2.0
repr-discriminantTrait to retrieve the discriminant of an enum variant with a repr(T) at runtime3,201MIT
iced_afThe iced application framework project.3,198BSD-3-Clause
randgeGenerate unique random numbers3,188MIT
xelfA versatile Rust toolkit for self-use.3,184MIT
enum_reflectEnums reflection library3,176MIT