Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    fn on_event(&mut self, event: &TestEvent) -> Result<()>;
    fn on_result(&mut self, result: &TestRunResult) -> Result<()>;

    // Provided method
    fn shutdown(&mut self) -> Result<()> { ... }
}
Expand description

A plugin that hooks into the test execution lifecycle.

Plugins receive events as they occur and can act on the final result. They are registered with a PluginManager before the test run starts.

Required Methods§

Source

fn name(&self) -> &str

Unique name identifying this plugin.

Source

fn version(&self) -> &str

Plugin version string.

Source

fn on_event(&mut self, event: &TestEvent) -> Result<()>

Called for each event during test execution.

Source

fn on_result(&mut self, result: &TestRunResult) -> Result<()>

Called once the test run is complete with the final result.

Provided Methods§

Source

fn shutdown(&mut self) -> Result<()>

Called when the plugin is being shut down (cleanup).

Implementors§