pub trait FromArg: Sized {
// Required method
fn from_arg(arg: &Arg) -> Result<Self>;
}Expand description
Converts a single Arg into a typed value.
Implement this trait to support a type as a field in #[derive(Attribute)]
structs. Built-in impls cover bool, String, integer/float primitives,
char, Ident, Path, Expr, LitStr, LitInt, Option<T>, Vec<T>,
and Args.
Required Methods§
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.