Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin:
    Send
    + Sync
    + 'static {
    // Required method
    fn name(&self) -> &'static str;

    // Provided method
    fn capabilities(&self) -> PluginCapabilities { ... }
}
Expand description

A registered extension. Each plugin declares which capability traits it implements via PluginCapabilities.

A plugin can implement any subset of: BeforeToolCall, AfterToolCall, ContextTransform, EventObserver, SteeringSource, FollowUpSource. The loop’s plugin dispatcher iterates registered plugins for each extension point.

Required Methods§

Source

fn name(&self) -> &'static str

Stable identifier for logs and telemetry.

Provided Methods§

Source

fn capabilities(&self) -> PluginCapabilities

Which capabilities this plugin implements. Default: none — meaning pure observation by inheriting from EventObserver. Override and return the relevant set when adding behavior.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§