#[unknown_upgrade_type]Expand description
Restricts function execution to requests with unknown protocol upgrade types only.
This attribute macro ensures the decorated function only executes when the incoming request uses an unrecognized or non-standard protocol upgrade type (not WebSocket, h2c, or TLS).
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/unknown_upgrade_type")]
struct UnknownUpgrade;
impl ServerHook for UnknownUpgrade {
async fn new(_ctx: &Context) -> Self {
Self
}
#[prologue_macros(unknown_upgrade_type, response_body("unknown upgrade type"))]
async fn handle(self, ctx: &Context) {}
}
impl UnknownUpgrade {
#[unknown_upgrade_type]
async fn unknown_upgrade_type_with_ref_self(&self, ctx: &Context) {}
}
#[unknown_upgrade_type]
async fn standalone_unknown_upgrade_type_handler(ctx: &Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.