Crate enum_str_derive

Source
Expand description

§enum-str-derive

License Contributors GitHub Repo stars crates.io

A crate to serialize/deserialize enums into/from a string.

Converts enums to a string when using serde and postgres.

§Documentation

§Implementation

use enum_str_derive::EnumStr;

#[derive(Clone, Copy, Debug, EnumStr)]
pub enum ChannelTypeShortcode {
  Text, // TEXT
  #[enum_str(string = "w")]
  Theater, // w
}

Derive Macros§

EnumStr