Skip to main content

rustbridge_plugin

Attribute Macro rustbridge_plugin 

Source
#[rustbridge_plugin]
Expand description

Attribute for marking a struct as a rustbridge plugin

This generates the necessary boilerplate for implementing the Plugin trait and dispatching messages to handler methods.

§Example

use rustbridge_macros::rustbridge_plugin;

#[rustbridge_plugin]
struct MyPlugin {
    // plugin state
}

impl MyPlugin {
    #[rustbridge_handler("user.create")]
    fn create_user(&self, req: CreateUserRequest) -> Result<CreateUserResponse, PluginError> {
        // handler implementation
    }
}