MagicArgs

Derive Macro MagicArgs 

Source
#[derive(MagicArgs)]
{
    // Attributes available to this derive:
    #[magic_args]
}
Available on crate feature derive only.
Expand description

A derive macro to help you create argument sets.

This macro can be used only on struct items.

Generate the appropriate Args implementations for the annotated type allowing it to be used with Callable.

§Field attributes

§skip

  • Syntax: #[magic_args(skip)]

Do not expose this field as an available argument. The resulting argument set will act as if this field does not exist.

#[derive(MagicArgs)]
struct Args(i32, usize, #[magic_args(skip)] &'static str);

fn f(_x: usize, _y: &'static str) {}

apply(f, Args(42, 42, "Hello, world!"));