pub struct PluginClient { /* private fields */ }Expand description
Thread-safe handle to a subprocess plugin. Cheap to clone —
the actual state lives behind an Arc<Mutex<…>>.
Implementations§
Source§impl PluginClient
impl PluginClient
Sourcepub fn new(
manifest: PluginManifest,
executable: PathBuf,
policy: LifetimePolicy,
) -> Self
pub fn new( manifest: PluginManifest, executable: PathBuf, policy: LifetimePolicy, ) -> Self
Build a fresh client. Does not spawn — the first
request call performs the lazy spawn.
pub fn manifest(&self) -> &PluginManifest
pub fn policy(&self) -> LifetimePolicy
Sourcepub async fn health(&self) -> PluginHealth
pub async fn health(&self) -> PluginHealth
Snapshot of the current health for doctor.
Sourcepub async fn clear_disabled(&self)
pub async fn clear_disabled(&self)
Manually clear the crash counter — used by doctor’s
“reset disabled plugin” affordance after the operator
has fixed whatever was crashing it.
Sourcepub async fn request(
&self,
call: PluginRequest,
) -> Result<PluginResponse, PluginClientError>
pub async fn request( &self, call: PluginRequest, ) -> Result<PluginResponse, PluginClientError>
Issue a single request. Spawns lazily, re-spawns on crash within the cap, and reaps an idle process before the next live call.
Trait Implementations§
Source§impl Clone for PluginClient
impl Clone for PluginClient
Source§fn clone(&self) -> PluginClient
fn clone(&self) -> PluginClient
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 moreSource§impl Drop for PluginClient
impl Drop for PluginClient
Auto Trait Implementations§
impl !RefUnwindSafe for PluginClient
impl !UnwindSafe for PluginClient
impl Freeze for PluginClient
impl Send for PluginClient
impl Sync for PluginClient
impl Unpin for PluginClient
impl UnsafeUnpin for PluginClient
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