Derive Macro PluginOption
#[derive(PluginOption)]
{
// Attributes available to this derive:
#[option]
}
Expand description
Derive PluginOption for a newtype struct over bool / i64 / String
(PH7.10b) — the guest-side ergonomic layer over the config.register-option
wire. Like PluginEvent, it is WIT-agnostic: it generates only metadata
constants + the value type; the plugin makes the register-option /
get-option WIT calls itself using them.
#[derive(PluginOption)] #[option(default = "8")] struct TabWidth(i64);
generates:
NAME— from#[option(name = "...")], else the type name kebab-cased.DOC— the struct’s///doc-comment.DEFAULT— the required#[option(default = "...")]string.KIND— theOptionKindinferred from the field type (bool→Boolean,i64→Integer,String→String).type Value— the field type (parse aget-optionresult vialattice_plugin_sdk::parse_option).