[][src]Struct shalc::Shalc

pub struct Shalc<Calc> { /* fields omitted */ }

Calculate and share specified calculation. Work algorythm is simple:

  1. Initialize Shalc by calling new(...) method and some Calculation.
  2. Call start(self) method to start calculation loop. In that loop: 2.1 Shalc recieve and applies commands. Commands can change Shalc state. 2.2 if state is State::Run: 2.2.1 Shalc calls local_calcs(...) from Calculation. 2.2.2 Shalc waits for Arc to Calculation will have only one reference. 2.2.3 Shalc gets mutable reference to Calculation from Arc and calls it's update(...) method. 2.2.4 Shalc sends Arc to OuterBonds::calcs_rx and jump to '2.1'. 2.2 if state is State::Pause, then Shalc waits for next commands without calculations. 2.3 if state is State::Exit, then Shalc break calculation loop and drops.

Methods

impl<Calc: Calculation + 'static> Shalc<Calc>[src]

pub fn new(
    calc: Arc<Calc>,
    logger: Option<Logger>,
    config: Config
) -> (Self, OuterBonds<Calc>)
[src]

Initialize new Shalc with specified Calculation. Returns Self and OuterBonds to communicate with it.

pub fn start(self) -> JoinHandle<()>[src]

Trait Implementations

impl<Calc: Debug> Debug for Shalc<Calc>[src]

Auto Trait Implementations

impl<Calc> !RefUnwindSafe for Shalc<Calc>

impl<Calc> Send for Shalc<Calc> where
    Calc: Send + Sync

impl<Calc> !Sync for Shalc<Calc>

impl<Calc> Unpin for Shalc<Calc>

impl<Calc> !UnwindSafe for Shalc<Calc>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.