Skip to main content

ValidatedFunction

Trait ValidatedFunction 

Source
pub trait ValidatedFunction<Input, Output> {
    // Required methods
    fn validateinputs(&self, input: &Input) -> SpecialResult<()>;
    fn compute_validated(&self, input: Input) -> SpecialResult<Output>;

    // Provided method
    fn evaluate(&self, input: Input) -> SpecialResult<Output> { ... }
}
Expand description

Standard validation trait for special functions

Required Methods§

Source

fn validateinputs(&self, input: &Input) -> SpecialResult<()>

Validate inputs before computation

Source

fn compute_validated(&self, input: Input) -> SpecialResult<Output>

Compute the function with validated inputs

Provided Methods§

Source

fn evaluate(&self, input: Input) -> SpecialResult<Output>

Main entry point that combines validation and computation

Implementors§