pub trait Validator<A>: Sealed {
type Prepared;
type Report;
// Required methods
fn prepare(
&self,
artifact: &A,
ctx: &ExecutionContext,
) -> Result<Self::Prepared, ValidationError>;
fn validate(
&self,
prepared: &mut Self::Prepared,
workspace: &mut EstimationWorkspace,
ctx: &ExecutionContext,
) -> Result<Self::Report, ValidationError>;
}Expand description
Validation / refutation algorithm over artifact type A .
validate also takes an EstimationWorkspace because effect refuters in
this crate refit estimators; DESIGN’s sketch omits it.
This trait is sealed: only types in this crate may implement it.
Required Associated Types§
Sourcetype Prepared
type Prepared
Prepared artifact produced by Self::prepare.
Sourcetype Report
type Report
Report produced by Self::validate.
Required Methods§
Sourcefn prepare(
&self,
artifact: &A,
ctx: &ExecutionContext,
) -> Result<Self::Prepared, ValidationError>
fn prepare( &self, artifact: &A, ctx: &ExecutionContext, ) -> Result<Self::Prepared, ValidationError>
Compile artifact into a reusable prepared form.
§Errors
Incompatible artifact or missing prerequisites.
Sourcefn validate(
&self,
prepared: &mut Self::Prepared,
workspace: &mut EstimationWorkspace,
ctx: &ExecutionContext,
) -> Result<Self::Report, ValidationError>
fn validate( &self, prepared: &mut Self::Prepared, workspace: &mut EstimationWorkspace, ctx: &ExecutionContext, ) -> Result<Self::Report, ValidationError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".