connect

Attribute Macro connect 

Source
#[connect]
Expand description

Restricts function execution to HTTP CONNECT requests only.

This attribute macro ensures the decorated function only executes when the incoming request uses the CONNECT HTTP method. Requests with other methods will be filtered out.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[route("/connect")]
struct Connect;

impl ServerHook for Connect {
    async fn new(_ctx: &Context) -> Self {
        Self
    }

    #[prologue_macros(connect, response_body("connect"))]
    async fn handle(self, ctx: &Context) {}
}

The macro takes no parameters and should be applied directly to async functions that accept a &Context parameter.