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.
abi_stableFor doing Rust-to-Rust ffi,writing libraries loaded at program startup.3,545,849MIT/Apache-2.0
cmp_anyComparison for &dyn types3,520,232MIT OR Apache-2.0
display_containerUtilities to implement Display3,506,602MIT OR Apache-2.0
decorumTotal ordering, equivalence, hashing, and constraints for floating-point types.3,499,344MIT
abi_stable_deriveImplementation detail of abi_stable.3,497,403MIT/Apache-2.0
la-arenaSimple index-based arena without deletion.3,485,489MIT OR Apache-2.0
thiserror-no-stdderive(Error)3,447,290MIT OR Apache-2.0
tstrtype-level strings on stable3,424,749Zlib
display_full_errorMinimal display formatter for error chains3,402,927MIT
include-flateA variant of include_bytes!/include_str! with compile-time deflation and runtime lazy inflation3,402,512Apache-2.0
pipe-traitMake it possible to chain regular functions3,365,809MIT
generativityGeneration of unique invariant lifetimes3,293,994MIT OR Apache-2.0
text-block-macrosCreate a multiline string literal3,291,544MIT
assert-eq-floatThis crate provides the `assert_eq_float!` macros that support floats.3,290,415MIT
stackfutureStackFuture is a wrapper around futures that stores the wrapped future in space provided by the caller.3,252,135MIT
version-syncCrate for ensuring that version numbers in README files and other files are kept in sync with the crate version.3,244,844MIT
build-fs-treeGenerate a filesystem tree from a macro or a YAML tree3,215,190MIT
io-enum#[derive(Read, Write, Seek, BufRead)] for enums.3,203,205Apache-2.0 OR MIT
embed-doc-imageEmbed images in Rust documentation2,922,502MIT
dyn-hashHash trait that is dyn-compatible2,914,996MIT OR Apache-2.0
rentalA macro to generate safe self-referential structs, plus premade types for common use cases.2,700,934MIT/Apache-2.0
anymap3A safe and convenient store for one value of each type2,495,300BlueOak-1.0.0 OR MIT OR Apache-2.0
build-timeSimple proc-macros to generate build timestamp string literals.2,492,899MIT
aliri_braidImprove and strengthen your strings by making them strongly-typed with less boilerplate2,463,699MIT OR Apache-2.0
mergeMerge multiple values into one2,454,526Apache-2.0 OR MIT
merge_deriveDerive macro for the merge::Merge trait2,437,076Apache-2.0 OR MIT
enum-assocProcedural macro to associate constants with enum variants.2,431,488MIT OR Apache-2.0
debug_panicThis allows a program to terminate immediately and provide feedback to the caller of the program. Unlike panic!, debug_panic!…2,344,478MIT
optfieldA macro that generates structs with optional fields2,301,951MIT OR Apache-2.0
pawCLI argument parser.2,297,512MIT OR Apache-2.0
take-untilA take_until extension for iterators2,287,795MIT
rust_infoExtracts the current rust compiler information.2,283,240Apache-2.0
forward_refRust's forward_ref_* macros for easier implementation of operator overloading.2,221,663MIT OR Apache-2.0
documentedDerive and attribute macros for accessing your type's documentation at runtime2,148,359MIT
dynifyAdd dyn compatible variant to your async trait2,126,363MIT OR Apache-2.0
with_locals-proc_macrosTODO!2,112,585Zlib OR MIT OR Apache-2.0
with_localsFunction attribute to return references to locals by using CPS2,105,410Zlib OR MIT OR Apache-2.0
func_wrapHelper crate for procedural macro authors that wish to duplicate some received function inside its body, so as to be able to wrap…2,102,313Zlib OR MIT OR Apache-2.0
owned-allocA crate to help reducing manual memory management errors.2,099,509MIT
unwrap-infallibleUnwrapping Result values with compile-time guarantee of infallibility2,042,200MIT OR Apache-2.0
futures-enum#[derive(Future, Stream, Sink, AsyncRead, AsyncWrite, AsyncSeek, AsyncBufRead)] for enums.2,011,655Apache-2.0 OR MIT
arraysConstruct an array from an iterator2,010,953MIT OR Apache-2.0
itermore🤸♀️ More iterator adaptors2,010,798MIT OR Apache-2.0
iterwindowsAn iterator adapter to iterate over all contiguous windows of length N1,987,445MIT OR Apache-2.0
validators-deriveThe provided crate offers a procedural macro for defining validators, including optional parameters.1,893,979MIT
try_matchFallible pattern matching with a function-like syntax1,868,748MIT OR Apache-2.0
pad-adapterA utility crate that provides pad adapter.1,812,654MIT OR Apache-2.0
amplifyAmplifying Rust language capabilities: multiple generic trait implementations, type wrappers, derive macros1,792,041MIT
parse_cfgParse and evaluate Rust's `cfg(any(condition))` attribute syntax and target triples1,787,444CC0-1.0 OR MIT
async_fn_traitsTrait synonyms for “Fn[…]”-trait bounds returning futures1,762,861MIT OR Apache-2.0
eieioError Implementing `Eq + Clone` replacing `std::io::Error`1,757,688MIT
shrinkwraprsAuto-derive for Rust conversion traits -- make working with newtypes a breeze1,749,796BSD-3-Clause
genawaiter-proc-macroprocedural macro for generators (genawaiter)1,740,930MIT/Apache-2.0
defmacA macro to define lambda-like macros inline.1,739,702Apache-2.0/MIT
amplify_derivePowerful derivation macros; part of the 'amplify' library1,729,120Apache-2.0
index_vecNewtype-style helpers for `Vec` and `usize`.1,691,042MIT/Apache-2.0
blanketA simple macro to derive blanket implementations for your traits.1,638,907MIT
random-number-macro-implGenerate random numbers quickly.1,638,753MIT
random-numberGenerate random numbers quickly.1,635,999MIT
amplify_synAmplifying syn capabilities: helper functions for creating proc macro libraries1,585,220Apache-2.0
veilRust derive macro for redacting sensitive data in `std::fmt::Debug`1,581,162MIT OR Apache-2.0
rc-boxKnown unique versions of Rc and Arc.1,567,304MIT OR Apache-2.0
takecellA cell type which value can only be taken once1,561,712MIT
from_variantsRust macro to automatically generate conversions for newtype enums.1,556,168MIT/Apache-2.0
ownableDerive macro for structs/enums with Cow, which can convert Type<'a> to Type<'static> and more1,542,424MIT OR Apache-2.0
enum-reprDerive enum repr conversions compatible with type aliases.1,519,218MIT OR Apache-2.0
dptreeAn asynchronous event dispatch mechanism for Rust1,493,252MIT
diesel-derive-newtypeAutomatically connect newtypes to Diesel using their wrapped type1,480,035Apache-2.0/MIT
const_forErgonomic for loop macro for const and no_std contexts1,475,258MIT
stringmatchAllow the use of regular expressions or strings wherever you need string comparison1,436,385MIT
concat-withExtend the function of the `concat!` macro in `std`.1,418,483MIT
strck_identChecked owned and borrowed Unicode-based identifiers1,416,170MIT
buildstructorMacro to derive a builder from a constructor function.1,403,175Apache-2.0
type_hashGenerate a hash for a Rust type.
The primary use-case for this crate is for detecting differences in message
types between…1,402,164MIT
derive-exImproved version of the macro to implement the traits defined in the standard library.1,372,773MIT OR Apache-2.0
numeric_castSafely cast between numbers1,321,384MIT
assertablesAssertables: assert macros for better testing, debugging, quality assurance, and runtime reliability.1,314,774MIT OR Apache-2.0 OR BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only
enum_delegate_libInternal macro implementations for enum_delegate - use to implement your own macros1,307,417MIT OR Apache-2.0
enum_delegateEasily replace dynamic dispatch with an enum, for speed and serialization1,306,977MIT OR Apache-2.0
derive_builder_macro_fork_artiRust macro to automatically implement the builder pattern for arbitrary structs.1,289,902MIT/Apache-2.0
rama-errorerror types and utilities for rama1,289,712MIT OR Apache-2.0
derive_builder_fork_artiRust macro to automatically implement the builder pattern for arbitrary structs.1,289,492MIT/Apache-2.0
open-enum-deriveAn attribute for generating "open" C-like enums, those that accept any integer value, by using a newtype struct and associated…1,229,311Apache-2.0
open-enumAn attribute for generating "open" fieldless enums, those that accept any integer value, by using a newtype struct and associated…1,228,861Apache-2.0
implsDetermine if a type implements a logical trait expression.1,218,298MIT OR Apache-2.0
implicit-clone-deriveImmutable types and ImplicitClone trait similar to Copy1,196,430MIT OR Apache-2.0
str-macroThe str!() macro, similar to vec![] but for strings1,183,274MIT
ra_ap_la-arenaSimple index-based arena without deletion.1,168,935MIT OR Apache-2.0
sark0y_tam_rstAutomation tool to make Console/Terminal more comfy. Have a great Day & Night, Dear User 💯❤️1,166,552non-standard
thiserror-ext-deriveProcedural macros for `thiserror_ext`.1,157,252Apache-2.0
thiserror-extUseful extension utilities for `thiserror`.1,156,523Apache-2.0
superstructVersioned data types with minimal boilerplate1,155,949Apache-2.0
assert_unorderedA direct replacement for `assert_eq` for unordered collections1,154,590MIT OR Apache-2.0
tiny-fnType erased closures on stack1,140,080MIT OR Apache-2.0
rust-fsm-dslMacros for rust-fsm DSL1,127,130MIT
rust-fsmA framework and a DSL for building finite state machines in Rust1,126,330MIT
hex-displayDisplay impl for byte slices which provides a hexdump1,116,652MIT OR Apache-2.0
std-nextOpinionated utilities and polyfills1,111,350MIT
once_mapSingle assignment and lazy maps1,105,131MIT OR Apache-2.0
tokio-async-dropmacro to enable async drop in a tokio multithreaded runtime1,100,938WTFPL
unchecked_unwrapAdds an unchecked version of `unwrap()` and `expect()` to Option and Result.1,065,905MIT OR Apache-2.0
disposeA simple wrapper for values that must be consumed on drop.1,060,375MIT OR Apache-2.0
dispose-deriveDerive macro for the dispose crate.1,059,877MIT OR Apache-2.0
extension-traitMacro to declare extension traits1,025,925MIT OR Apache-2.0
splitmutSafely retrieves multiple mutable values from the same collection.1,006,884Apache-2.0/MIT
ic-cdk-executorAsync executor for `ic-cdk`968,571Apache-2.0
likely_stablelikely and unlikely compiler hints in stable rust961,500MIT OR Apache-2.0
slugifyMacro for flexible slug generation958,386MIT
futures-async-stream-macroImplementation detail of the `futures-async-stream` crate.956,435Apache-2.0 OR MIT
futures-async-streamAsync stream for Rust and the futures crate.954,136Apache-2.0 OR MIT
testresultProvides TestResult type for concise and precise test failures947,510MIT OR Apache-2.0
slice-dstSlice-based custom DSTs947,484MIT OR Apache-2.0
derive_is_enum_variantAutomatically derives `is_dog` and `is_cat` methods for `enum Pet { Dog, Cat }`.937,721Apache-2.0/MIT
debugless-unwrapUnwrap Result<!Debug, !Debug> and Option<!Debug>930,630MIT OR Apache-2.0
inline-arrayefficient immutable inlinable byte array863,079MIT OR Apache-2.0
parse_argTraits and implementations for parsing command-line arguments.851,751MITNFA
concat-stringProvides macros for concatenating string slices into owned strings.841,917Apache-2.0 OR MIT
rusty-moneyParse, format and perform calculations with money safely.838,738MIT
formatxA macro for formatting non literal strings at runtime836,700MIT OR Apache-2.0
double-ended-peekableAn adapter providing peeking features to double-ended iterators.833,274MIT
struct-pathA helper macros to build a string that represents struct fields path at compile time (such as <field-name>.<field-name>)817,087Apache-2.0
safelogConditionally suppress confidential information from logs782,388MIT OR Apache-2.0
advent-of-codeSolutions to Advent of Code781,103MIT
tor-checkableTypes to ensure that signed or time-bound data is validated before use780,923MIT OR Apache-2.0
tor-unitsProvides macros for types which are constrained within a range, ensuring invalid values are unrepresentable.774,006MIT OR Apache-2.0
simple-loggingA simple logger for the log facade773,725BSD-3-Clause
retry-errorAn error type for an operation that can fail more than once773,240MIT OR Apache-2.0
caretMacros for declaring non-exhaustive C-style enumerations, with named members767,268MIT OR Apache-2.0
moddefMacro for convenient module declaration. Each module can be put in a group, and visibility can be applied to the whole group with…761,626MIT
fmt2ioA bridge between std::io::Write and std::fmt::Write.746,800MITNFA
tor-errorProvides the unified type-erased error type returned by many (esp. high-level) Tor APIs.746,433MIT OR Apache-2.0
tor-basic-utilsGeneral helpers used by Tor736,364MIT OR Apache-2.0
circuitbreaker-rsA production-grade, zero-boilerplate, lock-efficient, observability-ready Circuit Breaker library732,670MIT OR Apache-2.0
tuple_listCrate for macro-free variadic tuple metaprogramming717,093MIT
resiterHelper crate for handling iterators over result710,559MPL-2.0
tor-async-utilsAsync/futures helpers for use with Tor705,524MIT OR Apache-2.0
manifest-dir-macrosThis crate provides function-like macros to check or operate paths relative to CARGO_MANIFEST_DIR at compile time.705,185MIT
custom_errorDefine custom errors without boilerplate using the custom_error! macro.693,704BSD-2-Clause
stacksafe-macroProcedural macro implementation for the stacksafe crate.689,438Apache-2.0
stacksafePrevent stack overflow in deeply recursive functions with automatic stack management.689,179Apache-2.0
drop_guardThe drop_guard crate enables you to implement the Drop trait on any type.
So you can run a closure on any value running out of…672,308MIT/Apache-2.0
guardMacro implementation of RFC 1303: a guard-let-else statement a la Swift655,645MIT/Apache-2.0
byte-stringsRust byte strings manipulation, for a better and safer C FFI634,542Zlib OR MIT OR Apache-2.0
nonanyInteger types with customizable niche values605,017MIT OR Apache-2.0
defer-liteA lightweight high-performance implementation of Go's defer statement.604,692MIT
easy-errorSimple error utilities604,678MIT
velcroConvenience macros for initializing vectors, hash maps and other Rust collections.603,534Unlicense OR MIT
join-lazy-fmtLazy `separator.join(iterable)` method and `lazy_format!` for Rust602,548MIT
metastruct_macroAbstractions for iterating and mapping over struct fields (proc macro crate)594,307Apache-2.0
metastructAbstractions for iterating and mapping over struct fields593,735Apache-2.0
iter-enum#[derive(Iterator, DoubleEndedIterator, ExactSizeIterator, Extend)] for enums.589,357Apache-2.0 OR MIT
velcro_macrosProcedural macros used by the `velcro` crate. See `velcro` for documentation.
It is not advised to depend on this crate…584,150Unlicense OR MIT
velcro_coreCore dependencies used by the `velcro` crate. See `velcro` for documentation.
It is not advised to depend on this crate…583,038Unlicense OR MIT
partiallyProvides the Partial trait, and an optional macro to mirror a struct, wrapping each field in an Option570,816MIT OR Apache-2.0
partially_deriveMacros for the partially crate570,765MIT OR Apache-2.0
async-stdinAsynchronously read from stdin566,362MIT
oneshot-fused-workaroundFused wrapper for futures::channel::oneshot562,219MIT OR Apache-2.0
facet-coreCore reflection traits and types for the facet ecosystem - provides the Facet trait, Shape metadata, and type-erased pointers522,541MIT OR Apache-2.0
facetReflection for Rust: introspect types at compile time with metadata for serialization, pretty-printing, CLIs, and more522,300MIT OR Apache-2.0
sugarsAn useful collection of macros to make tasks easier.501,783non-standard
counted-arrayMacro for declaring fixed-size arrays without counting elements by hand. Supports lazy_static.500,336MIT
elainSet a type's minimum alignment with const generics.499,584MIT OR Apache-2.0
attr_aliasReduce attribute repetition with aliases494,761MIT OR Apache-2.0
socketpairCross-platform socketpair functionality487,128Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
const_fn_assertAssertions for const functions.480,166MIT
kameoFault-tolerant Async Actors Built on Tokio478,479MIT OR Apache-2.0
facet-macrosDerive macro for the Facet trait - proc macro powered by unsynn for compile-time type introspection477,837MIT OR Apache-2.0
init_withHelper trait to initilize an array with a function476,712Unlicense
error-graphAllows non-fatal errors in a tree of subfunctions to easily be collected by a caller476,634MIT
futures-await-testAsync test support for Rust through a procedural macro. This crate defines the
`#[async_test]` attribute to make writing tests…456,935MIT
databakeTrait that lets structs represent themselves as (const) Rust expressions456,056Unicode-3.0
concurrent-mapa lock-free linearizable B+ tree455,484MIT OR Apache-2.0
dyn-eqTest equality between trait objects452,429MPL-2.0
enoughMinimal cooperative cancellation trait for long-running operations450,747MIT OR Apache-2.0
databake-deriveCustom derive for the databake crate450,106Unicode-3.0
futures-await-test-macroHelper crate for futures-await-test.441,056MIT
whereatLightweight error location tracking with small sizeof and no_std support439,500MIT OR Apache-2.0
ebrsimple epoch-based reclamation with low cacheline ping-pong413,255MIT OR Apache-2.0
metainfoTransmissing metainfo across components.412,317MIT OR Apache-2.0
bounded-staticDefines the ToBoundedStatic and IntoBoundedStatic traits408,972Apache-2.0
qcellStatically-checked alternatives to RefCell and RwLock406,771MIT/Apache-2.0
lsetData types describing linear sets403,633Apache-2.0
format-bufDrop-in replacement for format! macro, which can write to existing buffer400,899MIT OR Apache-2.0
bip21Rust-idiomatic, compliant, flexible and performant BIP21 crate.397,515MITNFA
meticulousResult extension to add more meaning to unwrapping390,080MIT/Apache-2.0
next-genSafe generators on stable Rust.378,421Zlib OR MIT OR Apache-2.0
bounded-static-deriveMacro to derive ToBoundedStatic and IntoBoundedStatic traits377,055Apache-2.0
arch-intosafe type conversions between pointer-sized types (usize/isize) and types with fixed size374,154MIT/Apache-2.0
gazeboA collection of well-tested utilities370,319MIT OR Apache-2.0
as-dyn-traitAn attribute macro that generates methods for retrieving supertraits from trait-objects (upcasting).368,742Unlicense
require_unsafe_in_bodyMake `unsafe fn` still require `unsafe` blocks in the function's body363,233MIT
gazebo_deriveDerive macros for the Gazebo library358,629MIT OR Apache-2.0
gat-lending-iteratorA library for iterators who's items can [mutably] reference the iterator.358,078MIT
qp-trieAn idiomatic and fast QP-trie implementation in pure Rust, written with an emphasis on safety.355,606MPL-2.0
ref_thread_localA macro for declaring thread-local `static`s like using both of `lazy_static!` and `RefCell`354,513MIT
cfg-or-panicReplace function bodies with `unimplemented!()` when condition is not met.354,152Apache-2.0
lazy-static-includeThis crate provides `lazy_static_include_bytes` and `lazy_static_include_str` macros to replace `include_bytes` and `include_str`…354,009MIT
miden-mietteFancy diagnostic reporting library and protocol for us mere mortals who aren't compiler hackers.348,729Apache-2.0
bstringifystringify! that yields byte string literals instead348,026Zlib OR MIT OR Apache-2.0
nbytesRust compile-time evaluation of byte unit conversions340,323Apache-2.0