pub struct PluginContext {
pub role: PluginRole,
pub executor: Arc<dyn Executor>,
pub shutdown: Receiver<bool>,
pub rpc_registrar: Option<Arc<dyn RpcRegistrar>>,
pub health_registry: Option<Arc<dyn HealthRegistry>>,
pub metrics_registry: Option<Arc<dyn MetricsRegistry>>,
}Expand description
What every plugin receives in Plugin::boot.
All fields are cheaply cloneable (Arc or Receiver).
Fields§
§role: PluginRoleWhich process this plugin instance is booting in (phase 79).
In the master the executor is a
NoopExecutor (no PHP); in a worker it
dispatches into that worker’s PHP runtime. A Placement::Both plugin
branches on this; single-placement plugins can ignore it.
executor: Arc<dyn Executor>Send work to a PHP worker.
Valid only when role is
PluginRole::Worker; in the master it is a
NoopExecutor whose methods return Err.
shutdown: Receiver<bool>Fires true when the server is shutting down.
rpc_registrar: Option<Arc<dyn RpcRegistrar>>Register RPC method handlers. None if not available.
health_registry: Option<Arc<dyn HealthRegistry>>Register health checks. None if not available.
metrics_registry: Option<Arc<dyn MetricsRegistry>>Register metrics. None if not available.
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