Skip to main content

resolve_backend

Function resolve_backend 

Source
pub fn resolve_backend(
    name: &str,
    ctx: &BackendCtx,
) -> Result<Arc<dyn SandboxBackend>>
Expand description

Resolve worker.backend to a constructed SandboxBackend, fail-closed.

name is either a registered backend name or "auto". This is the single function both factories.rs and bin/main.rs route through — no scattered #[cfg], no _ => nspawn fallback.

  • "auto" → among auto_selectable registrations, the highest-priority one whose is_available is true; error if none (auto-excluded backends are never picked here — no silent downgrade).
  • concrete name → that registration if present and available, regardless of auto_selectable; otherwise error (unavailable → fail-closed; unknown → error listing the registry).