pub struct RouteEntry {
pub method: HttpMethod,
pub path: &'static str,
pub handler_type: &'static str,
pub rsp_type: &'static str,
pub name: TextRef,
pub description: TextRef,
pub category: TextRef,
pub params: &'static [ParamMeta],
pub authorization: &'static [AuthorizeRule],
}Expand description
A route entry registered at compile time via #[endpoint] (or its shortcuts #[get]/#[post]/…).
Collected by the inventory crate and read at application startup.
Fields§
§method: HttpMethodHTTP method for this route.
path: &'static strRoute path pattern (e.g., “/users/{id}”).
handler_type: &'static strType name of the request handler. Used to dispatch to the correct handler at runtime.
rsp_type: &'static strOpenAPI response type name (e.g., "UserModel", "Vec<UserModel>", "String").
name: TextRefHuman-readable endpoint name, as a resource reference.
From #[display], else the first line of the impl block’s /// doc
comment, else a name generated from the request type.
description: TextRefLong-form description, as a resource reference.
From #[description], else the impl block’s /// doc comment.
category: TextRefOptional grouping label, as a resource reference.
From #[category]; empty when the endpoint is uncategorized. Categories
are for display grouping only — they do not affect routing or
authorization.
params: &'static [ParamMeta]OpenAPI parameter metadata: path params, body params, etc.
Authorization rules from #[authorize]; empty = public endpoint.
Implementations§
Source§impl RouteEntry
impl RouteEntry
Sourcepub const fn new(
method: HttpMethod,
path: &'static str,
handler_type: &'static str,
rsp_type: &'static str,
name: TextRef,
description: TextRef,
category: TextRef,
params: &'static [ParamMeta],
authorization: &'static [AuthorizeRule],
) -> RouteEntry
pub const fn new( method: HttpMethod, path: &'static str, handler_type: &'static str, rsp_type: &'static str, name: TextRef, description: TextRef, category: TextRef, params: &'static [ParamMeta], authorization: &'static [AuthorizeRule], ) -> RouteEntry
Create a new route entry.
Trait Implementations§
Source§impl Clone for RouteEntry
impl Clone for RouteEntry
Source§fn clone(&self) -> RouteEntry
fn clone(&self) -> RouteEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more