pub struct LiveProcessBackend { /* private fields */ }Expand description
Process backend whose active mode and sandbox options can be swapped live while keeping the parent session’s background process supervisor and live-updatable permission view intact.
Newly spawned child sessions via ProcessBackend::new_session_with read
the latest swapped backend automatically, while Self::replace clears
stale session-retained grants and returns a new parent ProcessSession
bound to the same background supervisor and permission view so retained
background processes remain inspectable/stoppable and future subagents
inherit only post-reload grants.
Implementations§
Source§impl LiveProcessBackend
impl LiveProcessBackend
Sourcepub fn new(
workspace_root: impl Into<PathBuf>,
mode: ProcessBackendMode,
options: ProcessBackendOptions,
) -> Result<Self, ProcessBackendError>
pub fn new( workspace_root: impl Into<PathBuf>, mode: ProcessBackendMode, options: ProcessBackendOptions, ) -> Result<Self, ProcessBackendError>
Creates a live-swappable local process backend.
§Errors
Returns a ProcessBackendError when the initial backend configuration
is invalid or the requested isolated sandbox is unavailable.
Sourcepub fn from_session(session: ProcessSession) -> Self
pub fn from_session(session: ProcessSession) -> Self
Wraps a fixed process session (primarily for tests and custom adapters).
Sourcepub fn replace(
&self,
workspace_root: impl Into<PathBuf>,
mode: ProcessBackendMode,
options: ProcessBackendOptions,
) -> Result<ProcessSession, ProcessBackendError>
pub fn replace( &self, workspace_root: impl Into<PathBuf>, mode: ProcessBackendMode, options: ProcessBackendOptions, ) -> Result<ProcessSession, ProcessBackendError>
Validates and installs a replacement backend configuration, returning a
new parent ProcessSession sharing the existing background supervisor
and a freshly cleared session permission store.
If validation fails, the active backend and retained session permissions remain unchanged.
§Errors
Returns a ProcessBackendError when the new configuration is invalid
or the requested isolated sandbox is unavailable.