Skip to main content

ProcessBackend

Trait ProcessBackend 

Source
pub trait ProcessBackend: Send + Sync {
    // Required method
    fn new_session(&self) -> ProcessSession;

    // Provided method
    fn new_session_with(
        &self,
        _request: ProcessSessionRequest,
    ) -> Result<ProcessSession, ProcessBackendError> { ... }
}
Expand description

Stable host-process backend boundary consumed by coding composition.

The trait deliberately says nothing about how a platform enforces the selected behavior. Linux confines each action with Landlock and seccomp. Other targets report that isolation is unavailable instead of silently running on the host.

Required Methods§

Source

fn new_session(&self) -> ProcessSession

Creates the process session for one runtime owner.

Each call returns a session with the backend’s configured admission and runner capabilities. Backends may use a fresh session-scoped capability store for every call, which keeps parent and child runtime state isolated.

Provided Methods§

Source

fn new_session_with( &self, _request: ProcessSessionRequest, ) -> Result<ProcessSession, ProcessBackendError>

Creates a process session configured with scoped request options.

The default implementation delegates to Self::new_session for custom test or adapter backends that do not vary session parameters.

§Errors

Returns a ProcessBackendError when the requested workspace root, sandbox rules, or inherited permissions cannot be validated.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§