pub trait ImplTrait {
    fn path(&self) -> SimplePath;
    fn support_ignore(&self) -> bool;
    fn support_using(&self) -> bool;
    fn struct_items(
        &self,
        item: &ItemStruct,
        args: &ImplArgs
    ) -> Result<TokenStream>; fn struct_impl(
        &self,
        item: &ItemStruct,
        args: &ImplArgs
    ) -> Result<TokenStream> { ... } }
Expand description

Trait required by extensions

Required Methods

Trait path

The full path is printed in implementations. Only the last component is normally used when matching.

True if this target supports ignoring fields

True if this target supports using a field

Generate struct items

The resulting items are injected into an impl of the form impl<..> TraitName for StructName<..> where .. { #items }.

Provided Methods

Generate an impl for a struct item

The default implementation is a wrapper around Self::struct_items and suffices for most cases. It may be overridden, e.g. to generate multiple implementation items. It is not recommended to modify the generics.

Implementors