hotaru_meta

Crates.iohotaru_meta
lib.rshotaru_meta
version0.7.3
created_at2025-11-21 15:42:53.950075+00
updated_at2026-01-13 16:55:43.104222+00
descriptionCore macros for Hotaru
homepage
repositoryhttps://github.com/Field-of-Dreams-Studio/hotaru
max_upload_size
id1943732
size105,299
(JerrySu5379)

documentation

README

hotaru_meta

Crates.io

Procedural macros for the Hotaru web framework, providing declarative syntax for endpoint and middleware definition.

Macros

endpoint!

Define HTTP endpoints with automatic registration:

use hotaru_meta::endpoint;

endpoint! {
    APP.url("/api/users"),
    pub handle_users<HTTP> {
        text_response("User list")
    }
}

Fn-style lets you name the request variable:

use hotaru_meta::endpoint;

endpoint! {
    APP.url("/api/users"),
    pub fn handle_users(req: HTTP) {
        text_response("User list")
    }
}

middleware!

Define middleware with clean syntax:

use hotaru_meta::middleware;

middleware! {
    pub AuthMiddleware<HTTP> {
        // Middleware implementation
    }
}

Fn-style lets you name the request variable:

use hotaru_meta::middleware;

middleware! {
    pub fn AuthMiddleware(req: HTTP) {
        // Middleware implementation
    }
}

Features

  • Declarative endpoint registration
  • Protocol-generic middleware definition
  • Compile-time route validation
  • Automatic handler wrapping
  • Zero runtime overhead

Usage

This crate is automatically included when using the Hotaru framework. You typically don't need to add it directly.

License

GPL-3.0 License

Part of Hotaru Framework

This is the macro crate for the Hotaru web framework.

Learn more: https://fds.rs

Commit count: 9

cargo fmt