pub struct LocalProcessBackend { /* private fields */ }Expand description
Current local host-process backend.
The backend owns the current host implementation choice. Its public session contract is intentionally independent of that choice, so adding a platform-specific backend does not change coding profile or runtime APIs.
Implementations§
Source§impl LocalProcessBackend
impl LocalProcessBackend
Sourcepub fn from_session(session: ProcessSession) -> Self
pub fn from_session(session: ProcessSession) -> Self
Creates a fixed backend from one already constructed session.
This is intended for trusted adapters and deterministic test fixtures.
Platform-selected production backends should use Self::new so the
admission is created together with the concrete enforcement strategy.
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 platform-selected local process backend.
§Errors
Returns a ProcessBackendError when the selected backend cannot be
configured or the requested isolated behavior is unavailable.
Sourcepub fn unrestricted(
workspace_root: impl Into<PathBuf>,
options: ProcessBackendOptions,
) -> Result<Self, ProcessBackendError>
pub fn unrestricted( workspace_root: impl Into<PathBuf>, options: ProcessBackendOptions, ) -> Result<Self, ProcessBackendError>
Creates the current host-process implementation without an inner operating-system sandbox.
§Errors
Returns a ProcessBackendError::Runner when an environment override
cannot be validated by the host runner.
Sourcepub fn sandboxed(
workspace_root: impl Into<PathBuf>,
options: ProcessBackendOptions,
) -> Result<Self, ProcessBackendError>
pub fn sandboxed( workspace_root: impl Into<PathBuf>, options: ProcessBackendOptions, ) -> Result<Self, ProcessBackendError>
Creates the current isolated local-process implementation.
On Linux, each action is confined with Landlock and, unless that action
was granted network, a seccomp filter. On macOS, each action is confined
with a Seatbelt profile. Other targets return
ProcessBackendError::UnsupportedIsolation.
§Errors
Returns a ProcessBackendError when the workspace or sandbox
environment is invalid, a configured path cannot be enforced, or this
target has no isolated backend.