pub struct ValidatedRequest<P, Q, H, B> {
pub path: P,
pub query: Q,
pub headers: H,
pub body: B,
}Expand description
A request parsed and validated from its path, query, headers, and JSON body.
This extractor keeps each transport source in a separate application type, avoiding ambiguous precedence when the same field name appears in more than one source.
Fields§
§path: P§query: Q§headers: H§body: BTrait Implementations§
Source§impl<P, Q, H, B> FromRequest for ValidatedRequest<P, Q, H, B>where
P: DeserializeOwned + Validate + 'static,
Q: DeserializeOwned + Validate + 'static,
H: FromRequestHeaders + Validate + 'static,
B: DeserializeOwned + Validate + 'static,
impl<P, Q, H, B> FromRequest for ValidatedRequest<P, Q, H, B>where
P: DeserializeOwned + Validate + 'static,
Q: DeserializeOwned + Validate + 'static,
H: FromRequestHeaders + Validate + 'static,
B: DeserializeOwned + Validate + 'static,
Source§type Future = Pin<Box<dyn Future<Output = Result<ValidatedRequest<P, Q, H, B>, <ValidatedRequest<P, Q, H, B> as FromRequest>::Error>>>>
type Future = Pin<Box<dyn Future<Output = Result<ValidatedRequest<P, Q, H, B>, <ValidatedRequest<P, Q, H, B> as FromRequest>::Error>>>>
Future that resolves to a
Self. Read moreSource§fn from_request(request: &HttpRequest, payload: &mut Payload) -> Self::Future
fn from_request(request: &HttpRequest, payload: &mut Payload) -> Self::Future
Create a
Self from request parts asynchronously.Auto Trait Implementations§
impl<P, Q, H, B> Freeze for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> RefUnwindSafe for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> Send for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> Sync for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> Unpin for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> UnsafeUnpin for ValidatedRequest<P, Q, H, B>
impl<P, Q, H, B> UnwindSafe for ValidatedRequest<P, Q, H, B>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request