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§
- comptime_
b64 - Create a decoded base64 string at compile time.
- enum_
error - Create an error struct for an enum that implements
std::fmt::Displaythat can be used when using other macros to derivestd::str::FromStrfor an enum.
Derive Macros§
- Auto
DocFields - Create a function that is derived from the enum and returns the documentation of the variant as a static string that can be used.
- Auto
Getter - Derive the
AutoGettermacro for a struct - Deserialize
Enum - Derives
serde::Deserializefor an enum usingstd::str::FromStr - Deserialize
Enum32 - Derives
serde::Deserializefor an enum in i32 mode. - Deserialize
Enum32 Fallback - Derives
serde::Deserializefor an enum in i32 mode with fallback tostd::default::Default. - Enum
Count - Derives an enum that would implement
::count()to return the number of variants - Enum
Name - Derives an enum that would implement
.to_name() - EnumU32
- Derives an enum that would implement
From<u32>. - Enum
U32Fallback - Derives an enum that would implement
From<u32>with fallback. - Prost
Enum Unrecognized - A custom derive macro that follows similar pattern to
prost::Enumeration - Serialize
Enum - Derives
serde::Serializefor an enum usingstd::fmt::Display - Serialize
Enum32 - Derives
serde::Serializefor an enum in i32 mode.