pub struct Router { /* private fields */ }Implementations§
Source§impl Router
impl Router
pub fn new(config: Config, routes: impl Routes) -> Router
pub fn route(self, routes: impl Routes) -> Router
pub fn at(self, prefix: impl Into<String>) -> Router
pub fn fallback<Arguments, Input>(
self,
handler: impl Handler<Arguments, Input> + Send + Sync + 'static,
) -> Routerwhere
Arguments: 'static,
Input: 'static,
pub fn state<T>(self, state: T) -> Router
pub fn body_limit(self, limit: usize) -> Router
pub fn middleware<M>(self, middleware: M) -> Routerwhere
M: Middleware,
pub fn openapi(self, path: impl Into<String>, configuration: OpenApi) -> Router
pub fn openapi_document(&self) -> Option<&OpenApiDocument>
pub async fn handle(&self, request: Request) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for Router
impl !UnwindSafe for Router
impl Freeze for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin for Router
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