pub struct Core {
pub ident: Ident,
pub generics: Generics,
pub default: Option<DefaultExpression>,
pub rename_rule: RenameRule,
pub post_transform: Option<PostfixTransform>,
pub data: Data<InputVariant, InputField>,
pub bound: Option<Vec<WherePredicate>>,
pub allow_unknown_fields: Option<bool>,
}
Expand description
A struct or enum which should have FromMeta
or FromDeriveInput
implementations
generated.
Fields§
§ident: Ident
The type identifier.
generics: Generics
The type’s generics. If the type does not use any generics, this will be an empty instance.
default: Option<DefaultExpression>
Controls whether missing properties should cause errors or should be filled by the result of a function call. This can be overridden at the field level.
rename_rule: RenameRule
The rule that should be used to rename all fields/variants in the container.
post_transform: Option<PostfixTransform>
A transform which will be called on darling::Result<Self>
. It must either be
an FnOnce(T) -> T
when map
is used, or FnOnce(T) -> darling::Result<T>
when
and_then
is used.
map
and and_then
are mutually-exclusive to avoid confusion about the order in
which the two are applied.
data: Data<InputVariant, InputField>
The body of the deriving type.
bound: Option<Vec<WherePredicate>>
The custom bound to apply to the generated impl
allow_unknown_fields: Option<bool>
Whether or not unknown fields should produce an error at compilation time.
Implementations§
Source§impl Core
impl Core
Sourcepub fn start(di: &DeriveInput) -> Result<Self>
pub fn start(di: &DeriveInput) -> Result<Self>
Partially initializes Core
by reading the identity, generics, and body shape.