Skip to main content

plugin_impl

Attribute Macro plugin_impl 

Source
#[plugin_impl]
Expand description

Implement a plugin interface for a concrete type.

Generates extern ā€œCā€ FFI shims, a static vtable, a plugin descriptor, and a plugin registry.

§Example

ā“˜
pub struct MyGreeter;

#[plugin_impl(Greeter)]
impl Greeter for MyGreeter {
    fn greet(&self, name: String) -> String {
        format!("Hello, {name}!")
    }
}