Skip to main content

ValidatePayloadWith

Trait ValidatePayloadWith 

Source
pub trait ValidatePayloadWith<C> {
    type Inner: Validate<Context = C>;

    // Required method
    fn payload(&self) -> &Self::Inner;
}
Expand description

Helper trait that pulls a context-aware validatable payload out of common axum extractors.

Required Associated Types§

Source

type Inner: Validate<Context = C>

The inner type that implements garde::Validate with context C.

Required Methods§

Source

fn payload(&self) -> &Self::Inner

Borrow the inner value for validation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<U, C> ValidatePayloadWith<C> for Form<U>
where U: Validate<Context = C>,

Source§

type Inner = U

Source§

impl<U, C> ValidatePayloadWith<C> for Json<U>
where U: Validate<Context = C>,

Source§

type Inner = U

Source§

impl<U, C> ValidatePayloadWith<C> for Path<U>
where U: Validate<Context = C>,

Source§

type Inner = U

Source§

impl<U, C> ValidatePayloadWith<C> for Query<U>
where U: Validate<Context = C>,

Source§

type Inner = U

Source§

impl<U, C> ValidatePayloadWith<C> for TypedMultipart<U>
where U: Validate<Context = C>,

Source§

type Inner = U