kinded
Generate enums with same variants, but without data.
0.5.0
5.2M downloads/mo
#4451 most downloaded on crates.io
greyblake/kinded
What this package is like to depend on
Last release 6 months ago
03 Feb 2026
Release timing varies
gaps range from 3 months to 2.2 years
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
9 releases · first in 2023
3 releases in the last 12 months
see the full history below
Release timeline
9 releases · Aug 2023 to Feb 2026Releases
latest 9-
0.5.003 Feb 2026Release notes
Open source →What is kinded?
Kinded is a Rust procedural macro that generates a companion "kind" enum with the same variants as your original enum but without the associated data.
New Features
skip_deriveattributeOpt out of default trait implementations when you need custom behavior or want to avoid conflicts with other derives.
use kinded::Kinded; #[derive(Kinded)] #[kinded(skip_derive(Display, FromStr))] enum Status { Active, Inactive, } // Now you can implement Display and FromStr manually
Available traits to skip:
Display,FromStr,From,Clone,Copy,Debug,PartialEq,Eq.attrsattribute for generated enumPass extra attributes to the generated kind enum, useful for integrating with serde and other derive macros.
use kinded::Kinded; use serde::{Serialize, Deserialize}; #[derive(Kinded)] #[kinded(attrs(derive(Serialize, Deserialize), serde(rename_all = "snake_case")))] enum Beverage { Coffee(String), Tea { flavor: String }, Water, } // BeverageKind now has Serialize/Deserialize with snake_case naming
Per-variant
attrsattributeApply attributes to individual kind variants for fine-grained control.
use kinded::Kinded; use serde::{Serialize, Deserialize}; #[derive(Kinded)] #[kinded(attrs(derive(Serialize, Deserialize)))] enum Priority { #[kinded(attrs(serde(rename = "p0")))] Critical, #[kinded(attrs(serde(rename = "p1")))] High, Normal, Low, }
const fn kind()methodThe
kind()method is nowconst fn, enabling use in const contexts.use kinded::Kinded; #[derive(Kinded)] enum Direction { North, South, East, West, } const NORTH_KIND: DirectionKind = Direction::North.kind(); const fn is_vertical(dir: &Direction) -> bool { matches!(dir.kind(), DirectionKind::North | DirectionKind::South) }
Upgrading
Update your
Cargo.toml:[dependencies] kinded = "0.5"
Release notes
Open source →- Add
skip_deriveattribute to opt out of default trait implementations (fixes #19). - Add
attrsattribute to pass extra attributes to the generated kind enum (e.g.,#[kinded(attrs(serde(rename_all = "snake_case")))]) - Add per-variant
attrsattribute to pass attributes to individual kind variants (e.g.,#[kinded(attrs(default))]) (fixes #22) - Make
kind()methodconst fn, allowing usage in const contexts (fixes #12)
- Add
-
0.4.129 Jan 2026Release notes
Open source →- Add
#[kinded(rename = "...")]attribute for variants to customize display/parse names. This is useful when the automatic case conversion doesn't produce the desired result.
- Add
-
0.4.030 Oct 2025 -
0.3.009 Aug 2023Release notes
Open source →Changes
- [BREAKING] - Make
::all()function return an array instead of vector.
- [BREAKING] - Make
-
0.2.006 Aug 2023 -
0.1.105 Aug 2023Release notes
Open source →Changes
- Add
::all()to the kind type to iterate over all kind variants - Generate customizable implementation of
Displaytrait - Generate implementation of
FromStrtrait
Release notes
Open source →- Add
::all()to the kind type to iterate over all kind variants - Generate customizable implementation of
Displaytrait - Generate implementation of
FromStrtrait
- Add
-
0.0.304 Aug 2023 -
0.0.204 Aug 2023 -
0.0.104 Aug 2023