enumex

Crates.ioenumex
lib.rsenumex
version0.1.0
sourcesrc
created_at2023-07-14 13:10:43.557463
updated_at2023-07-14 13:10:43.557463
descriptionDerive Macro for Plain Enum
homepage
repositoryhttps://github.com/dryBranch/enumex.git
max_upload_size
id916023
size5,889
(dryBranch)

documentation

README

Enum Extend

Provide Derive Macro for Plain Enum

Example

derive EnumStr can impl Some Traits about str and String

  1. pub const as_str(&self) -> &'static str
  2. AsRef<str>
  3. ToString
  4. From<&str>
  5. From<&String>
  6. From<String>

From<Str> Maybe Panic!!!

use enumex::EnumStr;

#[derive(EnumStr)]
enum Animal {
    Cat,
    Dog,
}
Commit count: 3

cargo fmt