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§
Sourcefn validateinputs(&self, input: &Input) -> SpecialResult<()>
fn validateinputs(&self, input: &Input) -> SpecialResult<()>
Validate inputs before computation
Sourcefn compute_validated(&self, input: Input) -> SpecialResult<Output>
fn compute_validated(&self, input: Input) -> SpecialResult<Output>
Compute the function with validated inputs
Provided Methods§
Sourcefn evaluate(&self, input: Input) -> SpecialResult<Output>
fn evaluate(&self, input: Input) -> SpecialResult<Output>
Main entry point that combines validation and computation