pub struct RouteDefBuilder<H> { /* private fields */ }Expand description
Builder for route definitions that supports .name() and .middleware() chaining
Implementations§
Source§impl<H, Fut> RouteDefBuilder<H>
impl<H, Fut> RouteDefBuilder<H>
Sourcepub fn new(method: HttpMethod, path: &'static str, handler: H) -> Self
pub fn new(method: HttpMethod, path: &'static str, handler: H) -> Self
Create a new route definition builder
Sourcepub fn middleware<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn middleware<M: Middleware + 'static>(self, middleware: M) -> Self
Add middleware to this route
Sourcepub fn mcp_tool_name(self, name: &str) -> Self
pub fn mcp_tool_name(self, name: &str) -> Self
Override the auto-generated MCP tool name for this route
Sourcepub fn mcp_description(self, desc: &str) -> Self
pub fn mcp_description(self, desc: &str) -> Self
Override the auto-generated MCP description for this route
Sourcepub fn mcp_hint(self, hint: &str) -> Self
pub fn mcp_hint(self, hint: &str) -> Self
Add a hint that is appended to the MCP description for AI guidance
Hide this route from MCP tool discovery
Source§impl<H, Fut> RouteDefBuilder<H>
impl<H, Fut> RouteDefBuilder<H>
Sourcepub fn into_group_route(self) -> GroupRoute
pub fn into_group_route(self) -> GroupRoute
Convert this route definition to a type-erased GroupRoute
This is used internally when adding routes to a group.
Trait Implementations§
Source§impl<H, Fut> IntoGroupItem for RouteDefBuilder<H>
impl<H, Fut> IntoGroupItem for RouteDefBuilder<H>
fn into_group_item(self) -> GroupItem
Auto Trait Implementations§
impl<H> Freeze for RouteDefBuilder<H>where
H: Freeze,
impl<H> !RefUnwindSafe for RouteDefBuilder<H>
impl<H> Send for RouteDefBuilder<H>where
H: Send,
impl<H> Sync for RouteDefBuilder<H>where
H: Sync,
impl<H> Unpin for RouteDefBuilder<H>where
H: Unpin,
impl<H> UnsafeUnpin for RouteDefBuilder<H>where
H: UnsafeUnpin,
impl<H> !UnwindSafe for RouteDefBuilder<H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more