Skip to main content

Handler

Trait Handler 

Source
pub trait Handler {
    // Required methods
    fn metadata(&self) -> PluginInfo;
    fn on_event(&self, event: Event);
}
Expand description

The core trait for implementing a Hydrust plugin.

Users must implement this trait to define how the plugin identifies itself and how it responds to events.

Note: Your implementation struct must also implement Default, as the plugin instance is instantiated ephemerally for each call.

Required Methods§

Source

fn metadata(&self) -> PluginInfo

Returns metadata about the plugin.

This is called by the host to register the plugin’s name, version, and capabilities.

Source

fn on_event(&self, event: Event)

Handles an incoming event from the host.

§Arguments
  • event - The event data containing context and payload.

Implementors§