pub struct TraitImpl<'a> {
pub ident: &'a Ident,
pub generics: &'a Generics,
pub data: Data<Variant<'a>, Field<'a>>,
pub default: Option<DefaultExpression<'a>>,
pub post_transform: Option<&'a PostfixTransform>,
pub allow_unknown_fields: bool,
}
Fields§
§ident: &'a Ident
§generics: &'a Generics
§data: Data<Variant<'a>, Field<'a>>
§default: Option<DefaultExpression<'a>>
§post_transform: Option<&'a PostfixTransform>
§allow_unknown_fields: bool
Implementations§
source§impl<'a> TraitImpl<'a>
impl<'a> TraitImpl<'a>
sourcepub fn declared_type_params(&self) -> IdentSet
pub fn declared_type_params(&self) -> IdentSet
Get all declared type parameters.
sourcepub fn used_type_params(&self) -> IdentSet
pub fn used_type_params(&self) -> IdentSet
Get the type parameters which are used by non-skipped, non-magic fields.
These type parameters will have a FromMeta
bound applied to them in emitted
code.
fn type_params_matching<F, V>( &self, field_filter: F, variant_filter: V, ) -> IdentSet
source§impl<'a> TraitImpl<'a>
impl<'a> TraitImpl<'a>
sourcepub fn declare_errors(&self) -> ErrorDeclaration
pub fn declare_errors(&self) -> ErrorDeclaration
Gets the let
declaration for errors accumulated during parsing.
sourcepub fn check_errors(&self) -> ErrorCheck<'_>
pub fn check_errors(&self) -> ErrorCheck<'_>
Gets the check which performs an early return if errors occurred during parsing.
sourcepub(super) fn local_declarations(&self) -> TokenStream
pub(super) fn local_declarations(&self) -> TokenStream
Generate local variable declarations for all fields.
pub(super) fn post_transform_call(&self) -> Option<TokenStream>
sourcepub(super) fn fallback_decl(&self) -> TokenStream
pub(super) fn fallback_decl(&self) -> TokenStream
Generate local variable declaration and initialization for instance from which missing fields will be taken.
pub fn require_fields(&self) -> TokenStream
pub(super) fn initializers(&self) -> TokenStream
sourcepub(super) fn core_loop(&self) -> TokenStream
pub(super) fn core_loop(&self) -> TokenStream
Generate the loop which walks meta items looking for property matches.
fn make_field_ctx(&'a self) -> FieldsGen<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TraitImpl<'a>
impl<'a> RefUnwindSafe for TraitImpl<'a>
impl<'a> !Send for TraitImpl<'a>
impl<'a> !Sync for TraitImpl<'a>
impl<'a> Unpin for TraitImpl<'a>
impl<'a> UnwindSafe for TraitImpl<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more