pub struct ValidatedJson<T>(pub T);Expand description
Axum extractor that deserializes a JSON body and validates it with ValidationPipe.
JSON parsing errors keep Axum’s normal JSON rejection response. Values that parse successfully but fail validation return Nidus’s stable validation error response.
Tuple Fields§
§0: TImplementations§
Source§impl<T> ValidatedJson<T>
impl<T> ValidatedJson<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the extractor and returns the validated value.
Trait Implementations§
Source§impl<T: Clone> Clone for ValidatedJson<T>
impl<T: Clone> Clone for ValidatedJson<T>
Source§fn clone(&self) -> ValidatedJson<T>
fn clone(&self) -> ValidatedJson<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for ValidatedJson<T>
impl<T: Debug> Debug for ValidatedJson<T>
Source§impl<T> Deref for ValidatedJson<T>
impl<T> Deref for ValidatedJson<T>
Source§impl<T> DerefMut for ValidatedJson<T>
impl<T> DerefMut for ValidatedJson<T>
impl<T: Eq> Eq for ValidatedJson<T>
Source§impl<S, T> FromRequest<S> for ValidatedJson<T>
impl<S, T> FromRequest<S> for ValidatedJson<T>
Source§impl<T: PartialEq> PartialEq for ValidatedJson<T>
impl<T: PartialEq> PartialEq for ValidatedJson<T>
Source§fn eq(&self, other: &ValidatedJson<T>) -> bool
fn eq(&self, other: &ValidatedJson<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: PartialEq> StructuralPartialEq for ValidatedJson<T>
Auto Trait Implementations§
impl<T> Freeze for ValidatedJson<T>where
T: Freeze,
impl<T> RefUnwindSafe for ValidatedJson<T>where
T: RefUnwindSafe,
impl<T> Send for ValidatedJson<T>where
T: Send,
impl<T> Sync for ValidatedJson<T>where
T: Sync,
impl<T> Unpin for ValidatedJson<T>where
T: Unpin,
impl<T> UnsafeUnpin for ValidatedJson<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ValidatedJson<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