Expand description
Procedural derive macros backing the [pogo-masterfile-types] crate.
This crate is normally consumed transparently via re-exports from
pogo-masterfile-types. Direct dependency is fine but not required.
Derive Macros§
- AllVariants
- Derives
pub const ALL: [Self; N]andpub const SIZE: usizefor a unit-only enum. Visibility of the constants follows the enum’s own visibility. - AsStr
- Derives
pub const fn as_str(&self) -> &'static strandimpl Displayfor a unit-only enum. Each variant’s string is taken from a#[serde(rename = "...")]attribute; if absent, falls back tostringify!(VariantIdent). - From
StrEnum - Derives
impl FromStrANDimpl TryFrom<&str>for a unit-only enum. Both share the same string-matching logic:#[serde(rename = "...")]first, variant ident otherwise. The error type ispogo_masterfile_types::UnknownTemplateId— the macro emits a path reference; consumers must have that type in scope (which they do transparently via the parent crate). - Template
Id - Derives an inherent
template_id(&self) -> &strmethod for an enum whose every variant is a single-field tuple wrapping a struct with atemplate_id: Stringfield.