pub struct LocalSandboxAdapter { /* private fields */ }Expand description
Wraps LocalProcessSandbox to implement the synchronous SandboxPort trait.
Sandbox::apply is async; this adapter bridges the gap by spawning a
dedicated thread that blocks on the future, which is safe regardless of
whether the caller is inside a tokio runtime or not.
Implementations§
Source§impl LocalSandboxAdapter
impl LocalSandboxAdapter
Sourcepub fn new<S, P, Q>(run_id: S, workspace_root: P, temp_root: Q) -> Self
pub fn new<S, P, Q>(run_id: S, workspace_root: P, temp_root: Q) -> Self
Create a new adapter.
run_id— unique identifier for this pipeline runworkspace_root— root of the workspace being mutatedtemp_root— directory for temporary sandbox copies
Sourcepub fn with_policy(self, policy: SandboxPolicy) -> Self
pub fn with_policy(self, policy: SandboxPolicy) -> Self
Override the default SandboxPolicy.
Trait Implementations§
Source§impl SandboxPort for LocalSandboxAdapter
impl SandboxPort for LocalSandboxAdapter
Source§fn execute(&self, mutation: &PreparedMutation) -> SandboxExecutionResult
fn execute(&self, mutation: &PreparedMutation) -> SandboxExecutionResult
Apply the first mutation proposal (represented as a
PreparedMutation)
inside a sandbox and return the execution result.Auto Trait Implementations§
impl Freeze for LocalSandboxAdapter
impl RefUnwindSafe for LocalSandboxAdapter
impl Send for LocalSandboxAdapter
impl Sync for LocalSandboxAdapter
impl Unpin for LocalSandboxAdapter
impl UnsafeUnpin for LocalSandboxAdapter
impl UnwindSafe for LocalSandboxAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more