Crate enumscribe_derive
source ·Expand description
Derive macros for the traits provided by enumscribe
, to
help you easily convert your enums to strings and vice-versa.
See the documentation for the enumscribe
crate for usage
examples.
Derive Macros
- Derives
serde::Deserialize
for an enum. - Derives
serde::Serialize
for an enum. - Derives
enumscribe::ScribeCowStr
for an enum. This allows the enum to be converted to aCow<'static, str>
using thescribe()
method. - Derives
enumscribe::ScribeStaticStr
for an enum. This allows the enum to be converted to a&'static str
using thescribe()
method. - Derives
enumscribe::ScribeString
for an enum. This allows the enum to be converted to aString
using thescribe()
method. - Derives
enumscribe::TryScribeCowStr
for an enum. This allows the enum to be converted to aOption<Cow<'static, str>>
using thetry_scribe()
method. - Derives
enumscribe::TryScribeStaticStr
for an enum. This allows the enum to be converted to aOption<&'static str>
using thetry_scribe()
method. - Derives
enumscribe::TryScribeString
for an enum. This allows the enum to be converted to aOption<String>
using thetry_scribe()
method. - Derives
enumscribe::TryUnscribe
for an enum. This allows a&str
to be converted to anOption
of the enum using thetry_unscribe()
associated function. - Derives
enumscribe::Unscribe
for an enum. This allows a&str
to be converted to the enum using theunscribe()
associated function.