macro_rules! component_definition {
(@if_required required then { $($then:tt)* } $(else { $($else:tt)* })?) => { ... };
(@if_required then { $($then:tt)* } $(else { $($else:tt)* })?) => { ... };
(@if_from_str from_str then { $($then:tt)* } $(else { $($else:tt)* })?) => { ... };
(@if_from_str then { $($then:tt)* } $(else { $($else:tt)* })?) => { ... };
($vis:vis enum $name:ident {
$($variant:ident = $parse_variant:literal {$(
$(#[$required:tt])?
$field:ident = $parse_field:literal:
Option<$(#[$from_str:tt])? $field_type:ty>
=> $target_field:ident
),* $(,)?}),* $(,)?
}) => { ... };
}
Available on (crate features
formatting
or parsing
) and crate feature alloc
only.Expand description
Declare the Component
struct.