#[non_exhaustive]pub struct PluginContext {
pub vault: VaultApi,
pub hooks: HookBus,
pub storage: PluginStorage,
pub shutdown: ShutdownSignal,
}Expand description
Capabilities provided to a plugin when it is constructed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.vault: VaultApiCurated vault operations, bound to this plugin’s declaration.
hooks: HookBusBounded, advisory hook/event bus.
storage: PluginStorageDurable, plugin-private, per-vault key/value storage.
shutdown: ShutdownSignalCooperative shutdown signal for background work.
Implementations§
Source§impl PluginContext
impl PluginContext
Sourcepub fn new(
vault: VaultApi,
hooks: HookBus,
storage: PluginStorage,
shutdown: ShutdownSignal,
) -> Self
pub fn new( vault: VaultApi, hooks: HookBus, storage: PluginStorage, shutdown: ShutdownSignal, ) -> Self
Assemble a context. Called by the host.
Trait Implementations§
Source§impl Clone for PluginContext
impl Clone for PluginContext
Source§fn clone(&self) -> PluginContext
fn clone(&self) -> PluginContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PluginContext
impl !UnwindSafe for PluginContext
impl Freeze for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnsafeUnpin for PluginContext
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