Skip to content
D

Derive More

Some more derive(Trait) options

by JelteFFree

#1720in Developer Tools
0In stores

Description

derive_more is a Rust crate that adds derive macros for many traits the standard library does not derive for you. In Rust, when you wrap a b…

Highlights

  • Derive many standard traits for structs and enums
  • Conversion, formatting, error and operator traits
  • Makes the newtype pattern much less tedious
  • Each trait derived separately, with a documented list
  • cargo-expand suggested to inspect the generated code

Ratings & Reviews

No ratings yet

Be the first to rate Derive More.

People also visit

R

rust-trait-explorer

Explore Rust trait implementations using LSP

AI Skills
Get
M

m04-zero-cost

CRITICAL: Use for generics, traits, zero-cost abstraction

AI Skills
Get
U

Utoipa

Simple, Fast, Code first and Compile time generated OpenAPI documentation

Developer Tools
Launch
R

rust-patterns

Idiomatic Rust patterns, ownership, error handling, traits, concurrency

AI Skills
Get
R

rust-symbol-analyzer

Analyze Rust project structure using LSP symbols

AI Skills
Get
R

rust-engineer

Writes, reviews, and debugs idiomatic Rust code

AI Skills
Get

Derive More FAQ

What problem does it solve?

Wrapping a Rust type in your own struct or enum loses its trait implementations, and derive_more lets you derive them again with one line.

Which traits can I derive?

Conversion traits such as From and TryFrom, formatting traits such as Debug and Display, Error, and operator traits such as Add, Mul, Index and Deref.

Does deriving one trait derive related ones?

No. The README says you must derive each trait separately, so deriving Mul does not also derive Div.

How can I see the generated code?

The README suggests cargo-expand to show your type with all derives expanded.

What are the best Derive More alternatives?

Popular alternatives to Derive More include Utoipa, Data With Rust and Rust Playground. See all Derive More alternatives

Developer Stuff

Badges