Model

Trait Model 

Source
pub trait Model {
    type Input;
    type Output;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn call(&self, input: &Self::Input) -> Result<Self::Output, Self::Error>;
}
Expand description

A callable model that maps a typed input to a typed output.

Models must be deterministic, always producing the same result for a given input, which makes them a stable foundation for solvers, simulations, caching, and instrumentation.

Required Associated Types§

Source

type Input

Source

type Output

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn call(&self, input: &Self::Input) -> Result<Self::Output, Self::Error>

Calls the model with the given input.

§Errors

Each model defines its own Error type to represent domain-specific failures.

Implementors§