Skip to main content

detect

Function detect 

Source
pub fn detect(
    env: impl Fn(&str) -> Option<String>,
    on_path: impl Fn(&str) -> bool,
    healthz: impl Fn() -> bool,
) -> Environment
Expand description

Detect the environment via injected lookups: env(key) for env vars, on_path(bin) for PATH probes, healthz() for a live proxy probe. Pure decision logic; all I/O behind the closures.