pub struct HoldLastPredictor { /* private fields */ }Expand description
Hold-last predictor for numeric fields.
Implementations§
Source§impl HoldLastPredictor
impl HoldLastPredictor
pub const MIN_SAMPLES: usize = 1
pub fn new(window: usize) -> Self
pub fn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>
pub fn reset(&mut self)
pub fn samples(&self) -> &[(u64, f64)]
pub fn state_hash(&self) -> u64
pub fn predict(&self, _t: u64) -> Option<f64>
Trait Implementations§
Source§impl Clone for HoldLastPredictor
impl Clone for HoldLastPredictor
Source§impl Debug for HoldLastPredictor
impl Debug for HoldLastPredictor
Source§impl Predictor for HoldLastPredictor
impl Predictor for HoldLastPredictor
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.
Auto Trait Implementations§
impl Freeze for HoldLastPredictor
impl RefUnwindSafe for HoldLastPredictor
impl Send for HoldLastPredictor
impl Sync for HoldLastPredictor
impl Unpin for HoldLastPredictor
impl UnsafeUnpin for HoldLastPredictor
impl UnwindSafe for HoldLastPredictor
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