pub trait Validate {
    type Error;

    // Required method
    fn validate(&self) -> Result<(), Self::Error>;
}
Expand description

A trait for types which validate their state before construction finishes.

The generated builder will call this method if the #[builder(validate)] attribute is placed at the struct level.

Required Associated Types§

source

type Error

The error returned for an invalid value.

Required Methods§

source

fn validate(&self) -> Result<(), Self::Error>

Validates the state of self.

Implementors§