pub trait Predictor {
// Required methods
fn reset(&mut self);
fn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>;
fn predict(&self, t: u64) -> Option<f64>;
fn state_hash(&self) -> u64;
}Expand description
Object-safe numeric predictor interface used by the engine and custom models.
Required Methods§
Sourcefn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>
fn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>
Update predictor with a sample at time t and value x.
Sourcefn predict(&self, t: u64) -> Option<f64>
fn predict(&self, t: u64) -> Option<f64>
Predict value at time t. Must not mutate predictor state.
Sourcefn state_hash(&self) -> u64
fn state_hash(&self) -> u64
Deterministic hash of predictor state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".