pub trait ClientPlugin: MaybeSendSync + 'static {
type Api: MaybeSendSync + 'static;
// Required methods
fn manifest(&self) -> PluginManifest;
fn install(
&self,
context: PluginContext,
) -> PluginFuture<'_, Result<Arc<Self::Api>>>;
// Provided methods
fn on_ready(
&self,
_scope: PluginConnectionScope,
) -> PluginFuture<'_, Result<()>> { ... }
fn on_closed(
&self,
_scope: PluginConnectionScope,
) -> PluginFuture<'_, Result<()>> { ... }
fn shutdown(&self) -> PluginFuture<'_, Result<()>> { ... }
}Available on crate feature
plugins only.Expand description
A trusted native plugin installed exactly once while the client is still inert.
Capabilities shape the handles it receives; they are not an in-process sandbox.
A plugin value belongs to one client installation, even when registered through an Arc.
Required Associated Types§
type Api: MaybeSendSync + 'static
Required Methods§
fn manifest(&self) -> PluginManifest
fn install( &self, context: PluginContext, ) -> PluginFuture<'_, Result<Arc<Self::Api>>>
Provided Methods§
fn on_ready( &self, _scope: PluginConnectionScope, ) -> PluginFuture<'_, Result<()>>
fn on_closed( &self, _scope: PluginConnectionScope, ) -> PluginFuture<'_, Result<()>>
Sourcefn shutdown(&self) -> PluginFuture<'_, Result<()>>
fn shutdown(&self) -> PluginFuture<'_, Result<()>>
Release plugin-owned state. This may run after install began but returned an error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".