Trait EstimatorMut

Source
pub trait EstimatorMut<L: EstimationLogic + ?Sized>: Estimator<L> + AsMut<L::Backend> {
    // Required methods
    fn add(&mut self, element: impl Borrow<L::Item>);
    fn clear(&mut self);
    fn set(&mut self, backend: &L::Backend);
}
Expand description

A mutable estimator.

A mutable estimator must implement AsMut so to return a mutable reference to its backend.

Required Methods§

Source

fn add(&mut self, element: impl Borrow<L::Item>)

Adds an element to the estimator.

Source

fn clear(&mut self)

Clears the estimator, making it empty.

Source

fn set(&mut self, backend: &L::Backend)

Sets the contents of self to the the given backend.

If you need to set to the content of another estimator, just use as_ref on the estimator. This approach makes it possible to extract content from both owned and non-owned estimators.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<L: EstimationLogic + Clone, BL: Borrow<L>, B: AsRef<L::Backend> + AsMut<L::Backend>> EstimatorMut<L> for DefaultEstimator<L, BL, B>