plugin_api

Attribute Macro plugin_api 

Source
#[plugin_api]
Expand description

Expand to plugin_api_struct + plugin_api_trait

#[plugin_api(Client)]
pub trait ClientApi {
    async fn add(a: i32, b: i32) -> i32;
}

is equal to

#[plugin_api_struct]
pub struct Client;  // visibility is the same as the trait.

#[plugin_api_trait(Client)]
pub trait ClientApi {
    async fn add(a: i32, b: i32) -> i32;
}