[][src]Trait shalc::calculation::Calculation

pub trait Calculation: Send + Sync {
    type LocalCalcs: Sized;
    fn local_calcs(
        &self,
        prev_local_calcs: &mut Option<Self::LocalCalcs>
    ) -> State;
fn update(&mut self, local_calcs: &mut Option<Self::LocalCalcs>) -> State; }

Associated Types

type LocalCalcs: Sized

Calculations which is not sending to somewhere. It can be modified everywhere inside calculation.

Loading content...

Required methods

fn local_calcs(&self, prev_local_calcs: &mut Option<Self::LocalCalcs>) -> State

Calculations, that can be made when this calculation are shared and immutable. This method is used for updating LocalCalcs, which can be used to update mutable self in update() method.

fn update(&mut self, local_calcs: &mut Option<Self::LocalCalcs>) -> State

Method to update self. When it is called, self is not shared and, thats why, mutable.

Loading content...

Implementors

Loading content...