Skip to main content

PredictorState

Enum PredictorState 

Source
pub enum PredictorState {
    Linear(LinearPredictor),
    Quadratic(QuadraticPredictor),
    Cubic(CubicPredictor),
    Ewma(EwmaPredictor),
    HoldLast(HoldLastPredictor),
    Opaque(OpaqueHoldLast),
    Custom(Box<dyn Predictor>),
}

Variants§

Trait Implementations§

Source§

impl Predictor for PredictorState

Source§

fn reset(&mut self)

Reset predictor state to its initial value.
Source§

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>

Predict value at time t. Must not mutate predictor state.
Source§

fn state_hash(&self) -> u64

Deterministic hash of predictor state.
Source§

impl PredictorBuilder for PredictorState

Source§

fn build( spec: &FieldRef<'_>, field: &FieldInfo, ctx: &BuildCtx<'_>, ) -> Result<Self, ConfigError>

Source§

fn predict_opaque(&self) -> Option<&Value>

Source§

fn matches_opaque(&self, value: &Value) -> bool

Source§

fn update_opaque(&mut self, value: Value)

Source§

fn configure_opaque_pool(&mut self, word_off: usize, byte_off: usize)

Source§

fn opaque_state_hash(&self, words: &[u64], bytes: &[u8]) -> u64

Source§

fn predict_opaque_ref<'o>( &self, words: &'o [u64], bytes: &'o [u8], ) -> Option<OpaqueRef<'o>>

Source§

fn matches_opaque_ref( &self, value: OpaqueRef<'_>, words: &[u64], bytes: &[u8], ) -> bool

Source§

fn update_opaque_ref( &mut self, value: OpaqueRef<'_>, words: &mut [u64], bytes: &mut [u8], ) -> bool

Source§

fn predict_opaque_value(&self, words: &[u64], bytes: &[u8]) -> Option<Value>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.