[−][src]Struct shalc::Shalc
Calculate and share specified calculation. Work algorythm is simple:
- Initialize Shalc by calling
new(...)
method and some Calculation. - 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 callslocal_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'supdate(...)
method. 2.2.4 Shalc sends Arcto 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]
calc: Arc<Calc>,
logger: Option<Logger>,
config: Config
) -> (Self, OuterBonds<Calc>)
Initialize new Shalc with specified Calculation. Returns Self
and
OuterBonds
to communicate with it.
pub fn start(self) -> JoinHandle<()>
[src]
Trait Implementations
Auto Trait Implementations
impl<Calc> !RefUnwindSafe for Shalc<Calc>
impl<Calc> Send for Shalc<Calc> where
Calc: Send + Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,