Skip to main content

serve_on_shared_with

Function serve_on_shared_with 

Source
pub async fn serve_on_shared_with<F>(
    listener: Listener,
    handler: F,
    upgrades: Vec<(&str, UpgradeHandler)>,
) -> Result<()>
where F: Fn(HttpRequest) -> HttpResponse + Send + Sync + 'static,
Expand description

serve_on_shared with a table of protocol-upgrade paths (see UpgradeHandler) — a GET to one of them, asking to upgrade, is answered 101 and handed off instead of reaching handler. Every other request goes through the ordinary request/response path unchanged, so serve_on_shared(l, h) is exactly serve_on_shared_with(l, h, []).