Skip to main content

Validate

Trait Validate 

Source
pub trait Validate: Sized {
    type Context: ?Sized;
    type Output;
    type Error;

    // Required method
    fn validate_in_context(
        self,
        ctx: &Self::Context,
    ) -> Result<Self::Output, Self::Error>;

    // Provided method
    fn validate(self) -> Result<Self::Output, Self::Error>
       where Self::Context: From<()> { ... }
}
Expand description

Deterministic validation.

Types implementing Validate commit to a single, canonical notion of validity, encoded by the Output type. The implementation of Validate must ensure that all invariants assumed of Output hold, and Output itself should not be constructible in a way that would violate those invariants.

In other words, Output should correctly implement Valid.

§Examples

use peer_pressure::Validate;

struct RawAge(i32);

struct Age(u32);

impl Validate for RawAge {
    // Age being non-negative is a context-free property
    type Context = ();
    type Output = Age;
    type Error = &'static str;

    fn validate_in_context(self, _: &()) -> Result<Age, &'static str> {
        if self.0 >= 0 {
            Ok(Age(self.0 as u32))
        } else {
            Err("negative age")
        }
    }
}

let age = RawAge(30).validate().unwrap();
assert_eq!(age.0, 30);
assert!(RawAge(-1).validate().is_err());
use peer_pressure::Validate;

type ScrabbleHand = Vec<char>;
pub struct Word(String);

pub struct LegalWord(String);

impl Validate for Word {
    // A scrabble word is valid for a given set of letters on hand
    type Context = ScrabbleHand;
    type Output = LegalWord;
    type Error = &'static str;

    fn validate_in_context(self, hand: &ScrabbleHand) -> Result<LegalWord, Self::Error> {
        todo!("cmon, you can implement that yourself")
    }
}

Required Associated Types§

Source

type Context: ?Sized

Immutable context of the validation.

Use () for context-free checks.

Source

type Output

Validated form of Self.

Source

type Error

Validation error

Required Methods§

Source

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Validates self in given context, returning either a valid Output or Error.

Provided Methods§

Source

fn validate(self) -> Result<Self::Output, Self::Error>
where Self::Context: From<()>,

Validates self, returning either a valid Output or Error.

Available only for types with context-free validation (ie. for which Context is equivalent to ()).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Ctx: ?Sized, Err, A: Validate<Context = Ctx, Error = Err>, B: Validate<Context = Ctx, Error = Err>, C: Validate<Context = Ctx, Error = Err>, D: Validate<Context = Ctx, Error = Err>, E: Validate<Context = Ctx, Error = Err>, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<A as Validate>::Output, <B as Validate>::Output, <C as Validate>::Output, <D as Validate>::Output, <E as Validate>::Output, <F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, B: Validate<Context = Ctx, Error = Err>, C: Validate<Context = Ctx, Error = Err>, D: Validate<Context = Ctx, Error = Err>, E: Validate<Context = Ctx, Error = Err>, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<B as Validate>::Output, <C as Validate>::Output, <D as Validate>::Output, <E as Validate>::Output, <F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, C: Validate<Context = Ctx, Error = Err>, D: Validate<Context = Ctx, Error = Err>, E: Validate<Context = Ctx, Error = Err>, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<C as Validate>::Output, <D as Validate>::Output, <E as Validate>::Output, <F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, D: Validate<Context = Ctx, Error = Err>, E: Validate<Context = Ctx, Error = Err>, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<D as Validate>::Output, <E as Validate>::Output, <F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, E: Validate<Context = Ctx, Error = Err>, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<E as Validate>::Output, <F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, F: Validate<Context = Ctx, Error = Err>, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<F as Validate>::Output, <G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, G: Validate<Context = Ctx, Error = Err>, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<G as Validate>::Output, <H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, H: Validate<Context = Ctx, Error = Err>, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<H as Validate>::Output, <I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, I: Validate<Context = Ctx, Error = Err>, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<I as Validate>::Output, <J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, J: Validate<Context = Ctx, Error = Err>, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<J as Validate>::Output, <K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, K: Validate<Context = Ctx, Error = Err>, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<K as Validate>::Output, <L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, L: Validate<Context = Ctx, Error = Err>, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<L as Validate>::Output, <M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, M: Validate<Context = Ctx, Error = Err>, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<M as Validate>::Output, <N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, N: Validate<Context = Ctx, Error = Err>, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<N as Validate>::Output, <O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, O: Validate<Context = Ctx, Error = Err>, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (O, P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<O as Validate>::Output, <P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, P: Validate<Context = Ctx, Error = Err>, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (P, Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<P as Validate>::Output, <Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, Q: Validate<Context = Ctx, Error = Err>, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (Q, R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<Q as Validate>::Output, <R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, R: Validate<Context = Ctx, Error = Err>, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (R, S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<R as Validate>::Output, <S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, S: Validate<Context = Ctx, Error = Err>, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (S, T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<S as Validate>::Output, <T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, T: Validate<Context = Ctx, Error = Err>, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (T, U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<T as Validate>::Output, <U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, U: Validate<Context = Ctx, Error = Err>, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (U, V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<U as Validate>::Output, <V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, V: Validate<Context = Ctx, Error = Err>, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (V, W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<V as Validate>::Output, <W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, W: Validate<Context = Ctx, Error = Err>, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (W, X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<W as Validate>::Output, <X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, X: Validate<Context = Ctx, Error = Err>, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (X, Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<X as Validate>::Output, <Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Source§

impl<Ctx: ?Sized, Err, Y: Validate<Context = Ctx, Error = Err>, Z: Validate<Context = Ctx, Error = Err>> Validate for (Y, Z)

Source§

type Context = Ctx

Source§

type Output = (<Y as Validate>::Output, <Z as Validate>::Output)

Source§

type Error = Err

Source§

fn validate_in_context( self, ctx: &Self::Context, ) -> Result<Self::Output, Self::Error>

Implementors§