pub trait Derivable {
// Required method
fn ident(input: &DeriveInput, crate_name: &TokenStream) -> Result<Path>;
// Provided methods
fn implies_trait(_crate_name: &TokenStream) -> Option<TokenStream> { ... }
fn asserts(
_input: &DeriveInput,
_crate_name: &TokenStream,
) -> Result<TokenStream> { ... }
fn check_attributes(_ty: &Data, _attributes: &[Attribute]) -> Result<()> { ... }
fn trait_impl(
_input: &DeriveInput,
_crate_name: &TokenStream,
) -> Result<(TokenStream, TokenStream)> { ... }
fn requires_where_clause() -> bool { ... }
fn explicit_bounds_attribute_name() -> Option<&'static str> { ... }
fn perfect_derive_fields(_input: &DeriveInput) -> Option<Fields> { ... }
}Required Methods§
fn ident(input: &DeriveInput, crate_name: &TokenStream) -> Result<Path>
Provided Methods§
fn implies_trait(_crate_name: &TokenStream) -> Option<TokenStream>
fn asserts( _input: &DeriveInput, _crate_name: &TokenStream, ) -> Result<TokenStream>
fn check_attributes(_ty: &Data, _attributes: &[Attribute]) -> Result<()>
fn trait_impl( _input: &DeriveInput, _crate_name: &TokenStream, ) -> Result<(TokenStream, TokenStream)>
fn requires_where_clause() -> bool
fn explicit_bounds_attribute_name() -> Option<&'static str>
Sourcefn perfect_derive_fields(_input: &DeriveInput) -> Option<Fields>
fn perfect_derive_fields(_input: &DeriveInput) -> Option<Fields>
If this trait has a custom meaning for “perfect derive”, this function
should be overridden to return Some.
The default is “the fields of a struct; unions and enums not supported”.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.