Skip to main content

EstimatorArrayMut

Trait EstimatorArrayMut 

Source
pub trait EstimatorArrayMut<L: EstimationLogic + ?Sized>: EstimatorArray<L> {
    type EstimatorMut<'a>: EstimatorMut<L>
       where Self: 'a;

    // Required methods
    fn get_estimator_mut(&mut self, index: usize) -> Self::EstimatorMut<'_>;
    fn get_backend_mut(&mut self, index: usize) -> &mut L::Backend;
    fn clear(&mut self);
}
Expand description

An array of mutable estimators sharing an EstimationLogic.

Required Associated Types§

Source

type EstimatorMut<'a>: EstimatorMut<L> where Self: 'a

The type of mutable estimator returned by get_estimator_mut.

Required Methods§

Source

fn get_estimator_mut(&mut self, index: usize) -> Self::EstimatorMut<'_>

Returns the estimator at the specified index as a mutable estimator.

Note that this method will usually require some allocation, as it needs to create a new instance of EstimatorArrayMut::EstimatorMut.

Source

fn get_backend_mut(&mut self, index: usize) -> &mut L::Backend

Returns a mutable reference to the backend of the estimator at the specified index.

This method will usually require no allocation.

Source

fn clear(&mut self)

Resets all estimators in the array.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<L: SliceEstimationLogic<W> + Clone, W: Word, S: AsRef<[W]> + AsMut<[W]>> EstimatorArrayMut<L> for SliceEstimatorArray<L, W, S>

Source§

type EstimatorMut<'a> = DefaultEstimator<L, &'a L, &'a mut [W]> where Self: 'a