pub struct MethodRouter { /* private fields */ }Expand description
Per-path method table: get(list).post(create) (spec §4.1).
Implementations§
Source§impl MethodRouter
impl MethodRouter
pub fn on<H: Handler<A>, A>(self, method: Method, h: H) -> Self
Sourcepub fn body_limit(self, bytes: usize) -> Self
pub fn body_limit(self, bytes: usize) -> Self
Cap the request body for THIS route at bytes, overriding the app’s
1 MiB default (spec §4.4). The cap is per-route — it applies to every
method registered here, not per-method. Bodies over the cap are
rejected with 413 before the handler runs.
Sourcepub fn stream_body(self) -> Self
pub fn stream_body(self) -> Self
Marks every method on this route as STREAMING: the body is not buffered
before dispatch; extractors read it incrementally (Multipart) or drain it
on demand (Json/RawBody). body_limit still caps cumulative bytes.
pub fn get<H: Handler<A>, A>(self, h: H) -> Self
pub fn post<H: Handler<A>, A>(self, h: H) -> Self
pub fn put<H: Handler<A>, A>(self, h: H) -> Self
pub fn patch<H: Handler<A>, A>(self, h: H) -> Self
pub fn delete<H: Handler<A>, A>(self, h: H) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for MethodRouter
impl !UnwindSafe for MethodRouter
impl Freeze for MethodRouter
impl Send for MethodRouter
impl Sync for MethodRouter
impl Unpin for MethodRouter
impl UnsafeUnpin for MethodRouter
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