action

Attribute Macro action 

Source
#[action]
Expand description

#[action(…)] 属性宏

§参数

  • regex = "...": 匹配 key 的正则表达式(必需)
  • priority = N: 优先级,整数(可选,默认 0)
  • description = "...": 描述信息(可选)
  • sync = true/false: 是否启用全局同步模式(可选,默认 false)

§示例

#[action(regex = r"user/\d+", priority = 10, sync = true, description = "用户操作")]
fn handle_user(event: MyEvent) {
    // ...
}