Skip to main content

FromInput

Trait FromInput 

Source
pub trait FromInput: Sized {
    // Required method
    fn from_input(input: &Input) -> Result<Self, Diagnostic>;
}
Expand description

Extracts a value from the macro input context.

Implement this trait to define how a type is resolved from an Input (derive or item). Built-in impls exist for Ident, Generics, and Visibility. The #[element] macro uses this trait to auto-resolve extractor parameters.

Required Methods§

Source

fn from_input(input: &Input) -> Result<Self, Diagnostic>

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.

Implementors§