pub struct ServerPluginWrapper<S: ServerPlugin> { /* private fields */ }Expand description
Wraps a ServerPlugin so it can be used as a Plugin.
Spawns run at boot, awaits the task during shutdown.
Implementations§
Source§impl<S: ServerPlugin> ServerPluginWrapper<S>
impl<S: ServerPlugin> ServerPluginWrapper<S>
Trait Implementations§
Source§impl<S: ServerPlugin> Plugin for ServerPluginWrapper<S>
impl<S: ServerPlugin> Plugin for ServerPluginWrapper<S>
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable plugin name. Conventionally lowercase, single-word:
"http",
"jobs", "metrics". Used for log scoping, health/metric labels,
and config-section routing in custom builds.Source§fn boot<'life0, 'async_trait>(
&'life0 mut self,
ctx: PluginContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn boot<'life0, 'async_trait>(
&'life0 mut self,
ctx: PluginContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called once at server startup. Register RPC methods, health checks,
and metrics via
ctx, then spawn background tasks. Returning Err
is fatal: the server aborts startup.Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called during graceful shutdown. Returning
Err is logged but does
not abort shutdown of other plugins.Source§fn rpc_methods(&self) -> Vec<RpcMethodDef>
fn rpc_methods(&self) -> Vec<RpcMethodDef>
Optional: the RPC methods this plugin exposes. Used for advertising
(e.g.,
folk admin list-methods). Default is empty.Auto Trait Implementations§
impl<S> !Freeze for ServerPluginWrapper<S>
impl<S> RefUnwindSafe for ServerPluginWrapper<S>where
S: RefUnwindSafe,
impl<S> Send for ServerPluginWrapper<S>
impl<S> Sync for ServerPluginWrapper<S>
impl<S> Unpin for ServerPluginWrapper<S>
impl<S> UnsafeUnpin for ServerPluginWrapper<S>
impl<S> UnwindSafe for ServerPluginWrapper<S>where
S: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more