#[tls]Expand description
Restricts function execution to TLS-encrypted requests only.
This attribute macro ensures the decorated function only executes for requests that use TLS/SSL encryption on the connection.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/tls")]
struct Tls;
impl ServerHook for Tls {
async fn new(_ctx: &Context) -> Self {
Self
}
#[prologue_macros(tls, response_body("tls"))]
async fn handle(self, ctx: &Context) {}
}
impl Tls {
#[tls]
async fn tls_with_ref_self(&self, ctx: &Context) {}
}
#[tls]
async fn standalone_tls_handler(ctx: &Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.