Validate

Trait Validate 

Source
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§