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