pub struct RouteHandle<'r> { /* private fields */ }Expand description
Returned by get/post/… so a route can be named after registration.
Implementations§
Source§impl RouteHandle<'_>
impl RouteHandle<'_>
Sourcepub fn describe(self, summary: &str) -> Self
pub fn describe(self, summary: &str) -> Self
Say what this route does, in one line.
Documentation is attached here rather than kept in a separate file, so it cannot drift away from the route it describes.
Sourcepub fn tag(self, tag: &str) -> Self
pub fn tag(self, tag: &str) -> Self
Group this route under a heading in generated documentation.
Sourcepub fn responds(self, status: u16, description: &str) -> Self
pub fn responds(self, status: u16, description: &str) -> Self
Document a response this route can return.
Sourcepub fn param(self, name: &str, description: &str) -> Self
pub fn param(self, name: &str, description: &str) -> Self
Describe a parameter. Undescribed path parameters are still documented, just without prose.
Sourcepub fn deprecated(self) -> Self
pub fn deprecated(self) -> Self
Mark the route as deprecated in generated documentation.
Auto Trait Implementations§
impl<'r> !RefUnwindSafe for RouteHandle<'r>
impl<'r> !UnwindSafe for RouteHandle<'r>
impl<'r> Freeze for RouteHandle<'r>
impl<'r> Send for RouteHandle<'r>
impl<'r> Sync for RouteHandle<'r>
impl<'r> Unpin for RouteHandle<'r>
impl<'r> UnsafeUnpin for RouteHandle<'r>
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