pub struct JsonBody<T>(pub T);Expand description
JSON body extractor whose rejection (missing body, malformed JSON,
wrong content type) is a JSON 400 instead of axum’s defaults. Bodies
larger than the configured server.max_body_bytes are rejected with a
413 before deserialization.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: DeserializeOwned> FromRequest<Arc<AppState>> for JsonBody<T>
impl<T: DeserializeOwned> FromRequest<Arc<AppState>> for JsonBody<T>
Auto Trait Implementations§
impl<T> Freeze for JsonBody<T>where
T: Freeze,
impl<T> RefUnwindSafe for JsonBody<T>where
T: RefUnwindSafe,
impl<T> Send for JsonBody<T>where
T: Send,
impl<T> Sync for JsonBody<T>where
T: Sync,
impl<T> Unpin for JsonBody<T>where
T: Unpin,
impl<T> UnsafeUnpin for JsonBody<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for JsonBody<T>where
T: UnwindSafe,
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