Macro dusk_api::export_freight[][src]

macro_rules! export_freight {
    ($name:expr, $version:expr, $register:expr) => { ... };
}

A macro, which must be used for exporting a struct.

Every export must be done using this macro, to make sure the plugin is compatible with the program using it

To learn more about structure, required to register the plugins behavior, see Freight trait documentation

To learn how to do the same job easier automatically see register_freight! macro documentation and export_plugin! macro documentation

Example

dusk_api::export_freight!("test", "0.1.0", register);

pub fn register (registrar: &mut dyn FreightRegistrar) {
    registrar.register_freight(Box::new(MyFreight));
}

pub struct MyFreight;

impl Freight for MyFreight {
    // Your implementation here
}