Skip to main content

validated

Function validated 

Source
pub fn validated<T: Clone + Send + Sync + 'static>(
    req: &Request<impl Body>,
) -> T
Expand description

Extract the validated value from request extensions.

The ValidateJsonService middleware stores the parsed and validated struct in the request’s extensions map. Use this function (or req.extensions().get::<T>() directly) to retrieve it.

§Panics

Panics if T is not present in extensions (i.e. the middleware was not applied).