pub fn dispatch(
mode: DispatchMode,
canonical_uri: &str,
env: &dyn DeepLinkEnv,
) -> Result<DispatchOutcome, String>Expand description
Decide-and-dispatch. Pure decision logic over the DeepLinkEnv seam:
DispatchMode::Server→DispatchOutcome::ServeBrowser(no upsell); the handler is never probed and no URL is opened.DispatchMode::Auto→ if the handler is registered, build the deep link, open it, and returnDispatchOutcome::HandedOff; otherwiseDispatchOutcome::ServeBrowserwith the upsell.DispatchMode::Desktop→ if the handler is registered, hand off the same way; otherwiseDispatchOutcome::DesktopNotInstalled.
canonical_uri must already be canonicalised (see
canonicalize_target_uri); it is embedded verbatim (percent-encoded) in
the deep link and never carries a credential.