Skip to main content

export_plugin

Macro export_plugin 

Source
macro_rules! export_plugin {
    (@comp_descs $($comp:ty),*) => { ... };
    (@trans_descs $($trans:ty),*) => { ... };
    (@out_descs $($out:ty),*) => { ... };
    (@comparator_fns $($comp:ty),+) => { ... };
    (@transformer_fns $($trans:ty),+) => { ... };
    (@renderer_fns $($out:ty),+) => { ... };
    (
        module: $module_name:ident,
        comparators: [$($comp:ty),+ $(,)?] $(,)?
    ) => { ... };
    (
        module: $module_name:ident,
        transformers: [$($trans:ty),+ $(,)?] $(,)?
    ) => { ... };
    (
        module: $module_name:ident,
        renderers: [$($out:ty),+ $(,)?] $(,)?
    ) => { ... };
    (
        module: $module_name:ident,
        comparators: [$($comp:ty),+ $(,)?],
        transformers: [$($trans:ty),+ $(,)?] $(,)?
    ) => { ... };
}
Expand description

Export a plugin pack with any combination of comparators, transformers, and renderers.

Generates C ABI entry points conditionally based on declared types:

  • _binoc_plugin_describe (always)
  • _binoc_free_string (always)
  • _binoc_comparator_compare, _binoc_comparator_reopen, _binoc_comparator_extract (if comparators declared)
  • _binoc_transformer_transform, _binoc_transformer_extract (if transformers declared)
  • _binoc_renderer_render (if renderers declared)
  • Empty #[pymodule] when python feature active

§Example

export_plugin! {
    module: my_plugin,
    comparators: [MyComparator],
    transformers: [MyTransformer],
}