#[command]Expand description
Attribute macro #[command] for generating FFI bindings and client helpers
on a struct or enum that implements CommandHandler.
§Parameters
attr: TokenStream of attribute arguments (e.g.program = "foo", name = "bar").item: TokenStream of the annotated item (must be astructorenum).
§Behavior
- Parses
iteminto asyn::Item. - Parses
attrinto ourCommandArgshelper (extractingprogramandname). - If
itemis astructorenum, obtains its identifier (ident), builds/upgrades the program metadata viacreate_program_metadata(&args.program), and callsprocess_program_command(...)to emit the expanded FFI binding and metadata embedding. - If used on any other item, emits a compile error pointing at the original span,
instructing that
#[command]only applies to types implementingCommandHandler.