1use axiolid_core::Tolerance;
4
5use crate::{Diagnosis, RepairPlan, RepairReport};
6
7pub trait Diagnose<T>: core::fmt::Debug + Send + Sync {
9 type Error: std::error::Error + Send + Sync + 'static;
11
12 fn diagnose(&self, value: &T, tolerance: Tolerance) -> Result<Diagnosis, Self::Error>;
14}
15
16pub trait Repair<T>: core::fmt::Debug + Send + Sync {
18 type Error: std::error::Error + Send + Sync + 'static;
20
21 fn repair(
23 &self,
24 value: &T,
25 plan: &RepairPlan,
26 tolerance: Tolerance,
27 ) -> Result<(T, RepairReport), Self::Error>;
28}