pub struct SandboxedProcess { /* private fields */ }Expand description
A plugin running inside its own pdfork child process, confined to a
Capsicum capability sandbox.
The host talks to the child over the ipc socket. Drop (or
shutdown) closes the IPC socket and
reaps the child when the process descriptor is closed.
Implementations§
Source§impl SandboxedProcess
impl SandboxedProcess
Sourcepub fn request_metadata(&mut self) -> Result<PluginMetadataPayload>
pub fn request_metadata(&mut self) -> Result<PluginMetadataPayload>
Request the plugin’s static metadata over IPC.
§Errors
Returns PluginError::Sandbox on any IPC or protocol error, or
when the child reports an error / unexpected response.
Sourcepub fn shutdown(&mut self) -> Result<()>
pub fn shutdown(&mut self) -> Result<()>
Shut the child down: close the IPC socket (the child’s control loop
observes EOF and _exits), then drop the process descriptor, which
reaps the child via pdfork’s terminate-on-close semantics.
Safe to call more than once (subsequent calls are no-ops). This method does not block on the child: the kernel reaps it when the descriptor closes, regardless of timing.
§Errors
Currently always returns Ok; the Result is kept for API parity
with the non-FreeBSD stub and future synchronous-reap variants.