http0_9

Attribute Macro http0_9 

Source
#[http0_9]
Expand description

Restricts function execution to HTTP/0.9 requests only.

This attribute macro ensures the decorated function only executes for HTTP/0.9 protocol requests, the earliest version of the HTTP protocol.

ยงUsage

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

#[route("/http0_9")]
struct Http09;

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

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

impl Http09 {
    #[http0_9]
    async fn http0_9_with_ref_self(&self, ctx: &Context) {}
}

#[http0_9]
async fn standalone_http0_9_handler(ctx: &Context) {}

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