plugin_api_trait

Attribute Macro plugin_api_trait 

Source
#[plugin_api_trait]
Expand description

Define ffi call for each method in API struct.

Method arguments and return type should be:

  • no self (prepend automatically)
  • always async
  • serializable
  • no reference and mut

The implemetation will always use value, while the caller will always use reference.

pub struct Client;

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