1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! # Router Module
//!
//! This module provides the core traits and types for the routing system in Moonbeam.
//!
//! It includes:
//! - `RouteHandler`: A trait for types that can handle HTTP requests within a router.
//! - `PathParams`: A wrapper for extracting named path parameters from the URL.
//! - `FromParams`: A trait for converting raw path parameters into strongly-typed values.
//!
//! The routing system is designed to be used with the `#[route]` and `router!` macros
//! provided by the `moonbeam` crate (via `moonbeam-attributes`).
pub use ;
use crate::;
use Future;
/// Trait implemented by route handlers generated by the `#[route]` macro.
///
/// This trait defines the interface for handling requests with support for:
/// - Path parameters (e.g., `/users/:id`)
/// - Rest parameters (e.g., `/static/*path`)
/// - Application state injection
/// - Async argument extraction via `FromRequest`
///
/// Implementations of this trait are typically generated automatically by the `#[route]` macro.
/// While the trait's `call` method returns a concrete `Response`, the `#[route]` macro
/// allows the decorated function to return any type that implements `Into<Response>`.