Trait FromVarargs

Source
pub trait FromVarargs: Sized {
    // Required method
    fn read<'a>(args: &mut Varargs<'a>) -> Result<Self, Vec<ArgumentError<'a>>>;
}
Expand description

Trait for structures that can be parsed from Varargs.

This trait can be derived for structure types where each type implements FromVariant. The order of fields matter for this purpose:

#[derive(FromVarargs)]
struct MyArgs {
    foo: i32,
    bar: String,
    #[opt] baz: Option<Ref<Node>>,
}

Required Methods§

Source

fn read<'a>(args: &mut Varargs<'a>) -> Result<Self, Vec<ArgumentError<'a>>>

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§