Crate tosho_macros
source ·Expand description
§tosho-macros
A collection of macros used by tosho
and the other sources crates.
§License
This project is licensed with MIT License (LICENSE or http://opensource.org/licenses/MIT)
Macros§
- Create an error struct for an enum that implements
std::fmt::Display
that can be used when using other macros to derivestd::str::FromStr
for an enum.
Derive Macros§
- Derives
serde::Deserialize
for an enum usingstd::str::FromStr
- Derives
serde::Deserialize
for an enum in i32 mode. - Derives
serde::Deserialize
for an enum in i32 mode with fallback tostd::default::Default
. - Derives an enum that would implement
::count()
to return the number of variants - Derives an enum that would implement
.to_name()
- Derives an enum that would implement
From<u32>
. - Derives an enum that would implement
From<u32>
with fallback. - Derives
serde::Serialize
for an enum usingToString
- Derives
serde::Serialize
for an enum in i32 mode.