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