pub struct ValidatedWith<C, T>(pub T, _);Expand description
Context-aware validation extractor.
Validated<T> remains the zero-context fast path. Use
ValidatedWith<C, T> when the payload derives garde::Validate with
#[garde(context(C))]; the context is borrowed from axum state through
ValidationContext.
Tuple Fields§
§0: TImplementations§
Source§impl<C, T> ValidatedWith<C, T>
impl<C, T> ValidatedWith<C, T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the wrapper and return the extracted value.
Trait Implementations§
Source§impl<C: Clone, T: Clone> Clone for ValidatedWith<C, T>
impl<C: Clone, T: Clone> Clone for ValidatedWith<C, T>
Source§fn clone(&self) -> ValidatedWith<C, T>
fn clone(&self) -> ValidatedWith<C, 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 moreimpl<C: Copy, T: Copy> Copy for ValidatedWith<C, T>
Source§impl<C, T> Deref for ValidatedWith<C, T>
impl<C, T> Deref for ValidatedWith<C, T>
Source§impl<C, T> DerefMut for ValidatedWith<C, T>
impl<C, T> DerefMut for ValidatedWith<C, T>
Source§impl<S, C, T> FromRequest<S> for ValidatedWith<C, T>where
S: Send + Sync + ValidationContext<C>,
C: Send + Sync + 'static,
T: FromRequest<S> + ValidatePayloadWith<C> + Send,
impl<S, C, T> FromRequest<S> for ValidatedWith<C, T>where
S: Send + Sync + ValidationContext<C>,
C: Send + Sync + 'static,
T: FromRequest<S> + ValidatePayloadWith<C> + Send,
Source§impl<S, C, T> FromRequestParts<S> for ValidatedWith<C, T>where
S: Send + Sync + ValidationContext<C>,
C: Send + Sync + 'static,
T: FromRequestParts<S> + ValidatePayloadWith<C> + Send,
impl<S, C, T> FromRequestParts<S> for ValidatedWith<C, T>where
S: Send + Sync + ValidationContext<C>,
C: Send + Sync + 'static,
T: FromRequestParts<S> + ValidatePayloadWith<C> + Send,
Auto Trait Implementations§
impl<C, T> Freeze for ValidatedWith<C, T>
impl<C, T> RefUnwindSafe for ValidatedWith<C, T>
impl<C, T> Send for ValidatedWith<C, T>
impl<C, T> Sync for ValidatedWith<C, T>
impl<C, T> Unpin for ValidatedWith<C, T>
impl<C, T> UnsafeUnpin for ValidatedWith<C, T>
impl<C, T> UnwindSafe for ValidatedWith<C, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Formattable for T
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Parsable for T
Source§impl<C> ValidationContext<C> for C
impl<C> ValidationContext<C> for C
Source§fn validation_context(&self) -> &C
fn validation_context(&self) -> &C
Borrow the context used by
garde::Validate::validate_with.