pub struct EffectRuntime<S, A, E, St = EffectStore<S, A, E>>where
A: Action,
St: EffectStoreLike<S, A, E>,{ /* private fields */ }Expand description
Runtime helper for effect-based stores.
Implementations§
Source§impl<S, A, E> EffectRuntime<S, A, E>where
S: 'static,
A: Action,
impl<S, A, E> EffectRuntime<S, A, E>where
S: 'static,
A: Action,
Sourcepub fn new(
state: S,
reducer: fn(&mut S, A) -> DispatchResult<E>,
) -> EffectRuntime<S, A, E>
pub fn new( state: S, reducer: fn(&mut S, A) -> DispatchResult<E>, ) -> EffectRuntime<S, A, E>
Create a runtime from state + effect reducer.
Source§impl<S, A, E, St> EffectRuntime<S, A, E, St>where
S: 'static,
A: Action,
St: EffectStoreLike<S, A, E>,
impl<S, A, E, St> EffectRuntime<S, A, E, St>where
S: 'static,
A: Action,
St: EffectStoreLike<S, A, E>,
Sourcepub fn from_store(store: St) -> EffectRuntime<S, A, E, St>
pub fn from_store(store: St) -> EffectRuntime<S, A, E, St>
Create a runtime from an existing effect store.
Sourcepub fn with_debug(self, debug: DebugLayer<A>) -> EffectRuntime<S, A, E, St>where
S: DebugState,
A: ActionParams,
pub fn with_debug(self, debug: DebugLayer<A>) -> EffectRuntime<S, A, E, St>where
S: DebugState,
A: ActionParams,
Attach a debug layer (auto-wires tasks/subscriptions when available).
Sourcepub fn with_event_poller(
self,
config: PollerConfig,
) -> EffectRuntime<S, A, E, St>
pub fn with_event_poller( self, config: PollerConfig, ) -> EffectRuntime<S, A, E, St>
Configure event polling behavior.
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, St> Freeze for EffectRuntime<S, A, E, St>where
St: Freeze,
impl<S, A, E, St = EffectStore<S, A, E>> !RefUnwindSafe for EffectRuntime<S, A, E, St>
impl<S, A, E, St = EffectStore<S, A, E>> !Send for EffectRuntime<S, A, E, St>
impl<S, A, E, St = EffectStore<S, A, E>> !Sync for EffectRuntime<S, A, E, St>
impl<S, A, E, St> Unpin for EffectRuntime<S, A, E, St>
impl<S, A, E, St = EffectStore<S, A, E>> !UnwindSafe for EffectRuntime<S, A, E, 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