pub struct BackendRequest<'a> { /* private fields */ }Expand description
A portable command and effective policy submitted for backend preflight.
The request borrows the already validated values. It cannot be constructed
from a raw cageforge_policy::SandboxPolicy, which keeps composition a
mandatory boundary for native execution.
Implementations§
Source§impl<'a> BackendRequest<'a>
impl<'a> BackendRequest<'a>
Sourcepub const fn new(
command: &'a CommandRequest,
sandbox: &'a EffectiveSandbox,
) -> Self
pub const fn new( command: &'a CommandRequest, sandbox: &'a EffectiveSandbox, ) -> Self
Creates a backend request from a command and composed sandbox.
Sourcepub const fn command(&self) -> &'a CommandRequest
pub const fn command(&self) -> &'a CommandRequest
Returns the command intent.
Sourcepub const fn sandbox(&self) -> &'a EffectiveSandbox
pub const fn sandbox(&self) -> &'a EffectiveSandbox
Returns the effective sandbox constraint.
Sourcepub fn prepare_for<B: SandboxBackend>(
self,
backend: &B,
base_context: &PathResolutionContext,
) -> Result<PreparedBackendRequest<'a, B>, BackendContractError>
pub fn prepare_for<B: SandboxBackend>( self, backend: &B, base_context: &PathResolutionContext, ) -> Result<PreparedBackendRequest<'a, B>, BackendContractError>
Performs common preflight using exactly the capabilities advertised by
backend and the backend’s runtime path context.
This is the safe handoff entry point for native integrations. The
capability check is defined by Cageforge and cannot be overridden by a
backend implementation. The context is narrowed before return, and an
effective working directory must be supplied by the runtime context and
permitted by the effective filesystem policy. The returned value is
bound to B, so a handoff prepared for one backend type cannot be passed
to a native lowering method for another backend type by accident.
Sourcepub fn required_capabilities(&self) -> BackendCapabilities
pub fn required_capabilities(&self) -> BackendCapabilities
Computes the capabilities required by this request.
Trait Implementations§
Source§impl<'a> Clone for BackendRequest<'a>
impl<'a> Clone for BackendRequest<'a>
Source§fn clone(&self) -> BackendRequest<'a>
fn clone(&self) -> BackendRequest<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more