pub struct LoadedPlugin { /* private fields */ }Expand description
A live plugin instance: its Store (holding the scoped WASI view), the
lifecycle bindings, the per-call budget, its host-issued identity and
effective grant. Dropping it tears the Store down (the reload/teardown
seam PH7.12 formalises).
Implementations§
Source§impl LoadedPlugin
impl LoadedPlugin
Sourcepub fn id(&self) -> PluginId
pub fn id(&self) -> PluginId
The host-issued identity for this instance. The guest never influences it; it is the numeric id inside this plugin’s provenance.
Sourcepub fn source_layer(&self) -> SourceLayer
pub fn source_layer(&self) -> SourceLayer
The provenance layer the host stamps for every contribution this plugin
registers (PH7.3+). Host-issued from PluginId, so a plugin cannot
forge a builtin/user provenance — the acid test of §6.
Sourcepub fn grant(&self) -> &CapabilityGrant
pub fn grant(&self) -> &CapabilityGrant
The effective capability grant this plugin runs under.
Sourcepub fn denied_capabilities(&self) -> &[Capability]
pub fn denied_capabilities(&self) -> &[Capability]
Requested capabilities the trust tier withheld (e.g. proc:spawn for a
user-installed plugin). The host turns these into a “loaded with reduced
function” notification; the plugin still loaded.
Sourcepub fn data_dir(&self) -> Option<&Path>
pub fn data_dir(&self) -> Option<&Path>
The plugin’s private data dir, if it was instantiated with a grant
(PluginHost::instantiate_plugin). None for the degenerate
no-grant load.
Sourcepub async fn activate(&mut self) -> Result<(), PluginHostError>
pub async fn activate(&mut self) -> Result<(), PluginHostError>
Call the component’s activate export. For init.rs this runs the
user’s configuration; for the no-op component it returns immediately.
Fuel/epoch exhaustion or any wasm trap surfaces as
PluginHostError::Trap and leaves the host live.
Sourcepub async fn deactivate(&mut self) -> Result<(), PluginHostError>
pub async fn deactivate(&mut self) -> Result<(), PluginHostError>
Call the component’s deactivate export (teardown / reload).
Auto Trait Implementations§
impl !RefUnwindSafe for LoadedPlugin
impl !Sync for LoadedPlugin
impl !UnwindSafe for LoadedPlugin
impl Freeze for LoadedPlugin
impl Send for LoadedPlugin
impl Unpin for LoadedPlugin
impl UnsafeUnpin for LoadedPlugin
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more