pub struct Runtime<S, A, E = NoEffect, Routing = Direct, St = Store<S, A, E>>where
A: Action,
St: RuntimeStore<S, A, E>,{ /* private fields */ }Expand description
Runtime helper for store-driven applications.
Implementations§
Source§impl<S, A, E, Routing, St> Runtime<S, A, E, Routing, St>where
S: 'static,
A: Action,
St: RuntimeStore<S, A, E>,
impl<S, A, E, Routing, St> Runtime<S, A, E, Routing, St>where
S: 'static,
A: Action,
St: RuntimeStore<S, A, E>,
Sourcepub fn with_event_bus<Id, Ctx>(
self,
bus: EventBus<S, A, Id, Ctx>,
keybindings: Keybindings<Ctx>,
) -> Runtime<S, A, E, EventBusRouting<S, A, Id, Ctx>, St>
pub fn with_event_bus<Id, Ctx>( self, bus: EventBus<S, A, Id, Ctx>, keybindings: Keybindings<Ctx>, ) -> Runtime<S, A, E, EventBusRouting<S, A, Id, Ctx>, St>
Pair this runtime with an EventBus + Keybindings so raw events
are routed through the bus before actions are dispatched.
Source§impl<S, A, E, Routing, St> Runtime<S, A, E, Routing, St>where
S: 'static,
A: Action,
St: RuntimeStore<S, A, E>,
impl<S, A, E, Routing, St> Runtime<S, A, E, Routing, St>where
S: 'static,
A: Action,
St: RuntimeStore<S, A, E>,
Sourcepub fn with_debug<D>(self, debug: D) -> Runtime<S, A, E, Routing, St>where
D: DebugAdapter<S, A>,
pub fn with_debug<D>(self, debug: D) -> Runtime<S, A, E, Routing, St>where
D: DebugAdapter<S, A>,
Attach a debug layer.
Sourcepub fn with_event_poller(
self,
config: PollerConfig,
) -> Runtime<S, A, E, Routing, St>
pub fn with_event_poller( self, config: PollerConfig, ) -> Runtime<S, A, E, Routing, St>
Configure event polling behavior.
Sourcepub fn with_dispatch_error_handler<F>(
self,
handler: F,
) -> Runtime<S, A, E, Routing, St>
pub fn with_dispatch_error_handler<F>( self, handler: F, ) -> Runtime<S, A, E, Routing, St>
Configure handling for recoverable dispatch errors.
The handler receives each DispatchError and selects a
DispatchErrorPolicy. Runtimes do not log or store errors by default;
do that inside this closure when needed.
Sourcepub fn subscribe_actions(&self) -> Receiver<String>
pub fn subscribe_actions(&self) -> Receiver<String>
Subscribe to action name broadcasts.
Sourcepub fn action_tx(&self) -> UnboundedSender<A>
pub fn action_tx(&self) -> UnboundedSender<A>
Clone the action sender.
Auto Trait Implementations§
impl<S, A, E, Routing, St> Freeze for Runtime<S, A, E, Routing, St>
impl<S, A, E = NoEffect, Routing = Direct, St = Store<S, A, E>> !RefUnwindSafe for Runtime<S, A, E, Routing, St>
impl<S, A, E = NoEffect, Routing = Direct, St = Store<S, A, E>> !Send for Runtime<S, A, E, Routing, St>
impl<S, A, E = NoEffect, Routing = Direct, St = Store<S, A, E>> !Sync for Runtime<S, A, E, Routing, St>
impl<S, A, E, Routing, St> Unpin for Runtime<S, A, E, Routing, St>
impl<S, A, E, Routing, St> UnsafeUnpin for Runtime<S, A, E, Routing, St>where
St: UnsafeUnpin,
Routing: UnsafeUnpin,
impl<S, A, E = NoEffect, Routing = Direct, St = Store<S, A, E>> !UnwindSafe for Runtime<S, A, E, Routing, St>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more