pub trait ServerPlugin:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: PluginContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn rpc_methods(&self) -> Vec<RpcMethodDef> { ... }
}Expand description
Trait for plugins that run a single long-lived background task.
The run future should observe ctx.shutdown and return when signaled.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable plugin name (same semantics as Plugin::name).
Provided Methods§
Sourcefn rpc_methods(&self) -> Vec<RpcMethodDef>
fn rpc_methods(&self) -> Vec<RpcMethodDef>
Optional RPC method advertisements (default empty).