pub struct PluginContext {
pub peers: Arc<dyn PeerDirectory>,
pub control: Arc<dyn ControlSender>,
pub identity: Arc<dyn IdentitySecrets>,
pub data_dir: PathBuf,
pub cancel: CancellationToken,
}Expand description
Snapshot of services + scratch space handed to a plugin at startup.
Fields§
§peers: Arc<dyn PeerDirectory>Read-side access to the peer keystore.
control: Arc<dyn ControlSender>Outbound control-frame sender.
identity: Arc<dyn IdentitySecrets>Local identity (for ECIES decrypt etc.).
data_dir: PathBufDaemon data directory; plugins place their own files (databases, snapshots) under it.
cancel: CancellationTokenDaemon-wide cancellation token. Plugins should tie any long-running tasks to this so a clean shutdown propagates.
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 Freeze for PluginContext
impl !RefUnwindSafe for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnsafeUnpin for PluginContext
impl !UnwindSafe 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