Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime<S, M> {
    pub state: Arc<Mutex<S>>,
    pub bus: Bus<M>,
    pub env: Environment,
    /* private fields */
}
Expand description

Live runtime — bus-driven update loop on a pinned thread with Tokio effect interpreter.

Fields§

§state: Arc<Mutex<S>>§bus: Bus<M>§env: Environment

Implementations§

Source§

impl<S, M> Runtime<S, M>
where S: Send + Sync + 'static, M: Send + 'static,

Source

pub fn from_program( program: Program<S, M>, env: Environment, config: RuntimeConfig, ) -> Self

Source

pub fn from_reducer_program<R>( program: ReducerProgram<R>, env: Environment, config: RuntimeConfig, ) -> Self
where R: Reducer<State = S, Action = M> + Send + Sync + 'static,

Source

pub fn store(&self) -> Store<S, M>
where S: Clone + Send + Sync + 'static,

Source

pub fn dispatch(&self, msg: M)

Source

pub fn sender(&self) -> BusSender<M>

Source

pub fn cancel(&self, id: EffectId)

Source

pub fn shutdown(self)

Auto Trait Implementations§

§

impl<S, M> !Freeze for Runtime<S, M>

§

impl<S, M> !RefUnwindSafe for Runtime<S, M>

§

impl<S, M> !UnwindSafe for Runtime<S, M>

§

impl<S, M> Send for Runtime<S, M>
where S: Send + Sync, M: Send,

§

impl<S, M> Sync for Runtime<S, M>
where S: Send + Sync, M: Send,

§

impl<S, M> Unpin for Runtime<S, M>
where M: Unpin,

§

impl<S, M> UnsafeUnpin for Runtime<S, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V