routing
Module: routing
Section titled “Module: routing”Contents
Section titled “Contents”Structs
AutostartFlags- Inputs to [prepare_network_runtime] that gate autostart behaviour.NetworkRuntime- Runtime-side network artifacts that must live while the wrapped process runs.ResolvedAuthority- Resolved Authority for the current run. URL is what gets fed into the
Functions
prepare_network_runtime- Prepare network runtime artifacts for a sandbox launch.resolve_authority- Step 0: resolve the Authority before any sidecar work.
firma_run::routing::AutostartFlags
Section titled “firma_run::routing::AutostartFlags”Struct
Inputs to [prepare_network_runtime] that gate autostart behaviour.
Fields:
sidecar_autostart: bool-truewhen the selection resolved to local autostart.no_autostart: booltemplate_path: Option<std::path::PathBuf>startup_timeout: std::time::Durationauthority_url: Option<String>- Effective Authority URL — set byresolve_authorityand threadeduse_http_proxy_sidecar: bool- Whentrue, the autostarted sidecar is started in HTTP proxy
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Clone
fn clone(self: &Self) -> AutostartFlags
firma_run::routing::NetworkRuntime
Section titled “firma_run::routing::NetworkRuntime”Struct
Runtime-side network artifacts that must live while the wrapped process runs.
Methods:
fn env_overrides(self: &Self) -> &BTreeMap<String, String>- Returns environment values to merge into wrapped process launch env.fn sidecar_endpoint(self: &Self) -> &SidecarEndpoint- Endpoint the wrapped process should reach the sidecar through.
firma_run::routing::ResolvedAuthority
Section titled “firma_run::routing::ResolvedAuthority”Struct
Resolved Authority for the current run. URL is what gets fed into the
sidecar’s [authority].url; supervisor is held inside NetworkRuntime
for kill-on-Drop.
Fields:
url: Stringsupervisor: Option<crate::authority::AuthoritySupervisor>
firma_run::routing::prepare_network_runtime
Section titled “firma_run::routing::prepare_network_runtime”Function
Prepare network runtime artifacts for a sandbox launch.
When flags.sidecar_autostart == true (local selection), autostarts a
per-run sidecar via
[SidecarSupervisor] and substitutes its endpoint into the returned
[NetworkRuntime]. The supervisor is held inside the returned struct so
[Drop] tears the sidecar down when the wrapped process exits.
Errors
Section titled “Errors”- [
RunError::SidecarUnreachable] when the endpoint is unreachable and autostart is disabled. - [
RunError::SidecarReadyTimeout] / [RunError::SidecarStartupFailed] when the autostarted sidecar fails to come up. - [
RunError::UnsupportedPlatform] when autostart is required on a platform that does not support it. - [
RunError::Backend] for adapter socket failures.
fn prepare_network_runtime(handle: &crate::backend::SandboxHandle, sidecar_endpoint: &crate::config::SidecarEndpoint, identity: &crate::identity::RunIdentity, flags: &AutostartFlags, authority: ResolvedAuthority) -> Result<NetworkRuntime, crate::error::RunError>firma_run::routing::resolve_authority
Section titled “firma_run::routing::resolve_authority”Function
Step 0: resolve the Authority before any sidecar work.
CLI > persisted > prompt (only when both empty and TTY). On Local
selection, probe [::1]:50051; on miss, spawn an
AuthoritySupervisor. Local mode is a dev convenience path and
intentionally uses plaintext loopback (http://), not TLS/mTLS.
EADDRINUSE recovery: on any spawn error, re-probe once; if the port
is now reachable, drop the (failed) supervisor handle and proceed
without one.
Errors
Section titled “Errors”Propagates any RunError raised by selection or spawn paths.
fn resolve_authority(identity: &crate::identity::RunIdentity, runtime_dir: &std::path::Path, flags: &AutostartFlags, cli: &crate::authority::AuthorityCli, profile_name: &str, user_config_path: &std::path::Path, firma_exe: &std::path::Path, prompt: & mut dyn crate::authority::AuthorityPromptIo) -> Result<ResolvedAuthority, crate::error::RunError>