pub enum PredictorState {
Linear(LinearPredictor),
Quadratic(QuadraticPredictor),
Cubic(CubicPredictor),
Ewma(EwmaPredictor),
HoldLast(HoldLastPredictor),
Opaque(OpaqueHoldLast),
Custom(Box<dyn Predictor>),
}Variants§
Linear(LinearPredictor)
Quadratic(QuadraticPredictor)
Cubic(CubicPredictor)
Ewma(EwmaPredictor)
HoldLast(HoldLastPredictor)
Opaque(OpaqueHoldLast)
Custom(Box<dyn Predictor>)
Trait Implementations§
Source§impl Predictor for PredictorState
impl Predictor for PredictorState
Source§fn 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.Source§fn predict(&self, t: u64) -> Option<f64>
fn predict(&self, t: u64) -> Option<f64>
Predict value at time
t. Must not mutate predictor state.Source§fn state_hash(&self) -> u64
fn state_hash(&self) -> u64
Deterministic hash of predictor state.
Source§impl PredictorBuilder for PredictorState
impl PredictorBuilder for PredictorState
fn build( spec: &FieldRef<'_>, field: &FieldInfo, ctx: &BuildCtx<'_>, ) -> Result<Self, ConfigError>
fn predict_opaque(&self) -> Option<&Value>
fn matches_opaque(&self, value: &Value) -> bool
fn update_opaque(&mut self, value: Value)
fn configure_opaque_pool(&mut self, word_off: usize, byte_off: usize)
fn opaque_state_hash(&self, words: &[u64], bytes: &[u8]) -> u64
fn predict_opaque_ref<'o>( &self, words: &'o [u64], bytes: &'o [u8], ) -> Option<OpaqueRef<'o>>
fn matches_opaque_ref( &self, value: OpaqueRef<'_>, words: &[u64], bytes: &[u8], ) -> bool
fn update_opaque_ref( &mut self, value: OpaqueRef<'_>, words: &mut [u64], bytes: &mut [u8], ) -> bool
fn predict_opaque_value(&self, words: &[u64], bytes: &[u8]) -> Option<Value>
Auto Trait Implementations§
impl !RefUnwindSafe for PredictorState
impl !Send for PredictorState
impl !Sync for PredictorState
impl !UnwindSafe for PredictorState
impl Freeze for PredictorState
impl Unpin for PredictorState
impl UnsafeUnpin for PredictorState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more