Expand description
§es-fluent-derive
Procedural macros behind the es-fluent typed-message facade.
Applications should import these derives from
es-fluent rather than depending on this
crate directly.
The crate implements:
EsFluentfor structs and enum messages;EsFluentChoicefor standalone selector enums;EsFluentVariantsfor field or variant metadata; andEsFluentLabelfor type-level labels.
ⓘ
use es_fluent::{EsFluent, EsFluentLabel};
#[derive(EsFluent, EsFluentLabel)]
pub enum AccountMessage<'a> {
Welcome { name: &'a str },
SignedOut,
}Derives support argument transforms, selectors, explicit keys, package-local domains, and namespace-based file splitting.
Derive Macros§
- EsFluent
- Turns an enum or struct into a localizable message.
- EsFluent
Choice - Allows an enum to be used inside another message as a selector (e.g., for gender or status).
- EsFluent
Label - Generates a helper implementation of the
FluentLabeltrait and registers the type’s name as a key. - EsFluent
Variants - Generates variant enums for struct fields.