[][src]Trait reducer::Dispatcher

pub trait Dispatcher<A> {
    type Output;
    fn dispatch(&mut self, action: A) -> Self::Output;
}

Trait for types that allow dispatching actions.

Associated Types

type Output

Loading content...

Required methods

fn dispatch(&mut self, action: A) -> Self::Output

Loading content...

Implementors

impl<A, O> Dispatcher<A> for AsyncDispatcher<A, O> where
    A: Send + 'static,
    O: Send + 'static, 
[src]

type Output = BoxFuture<'static, O>

A Future that represents asynchronously dispatched actions.

Important: do not rely on the actual type, this will become an existential type once issues with rustdoc are solved.

fn dispatch(&mut self, action: A) -> Self::Output[src]

Asynchronously sends an action to the associated spawned Dispatcher and returns a future to the result.

Important: The action is only guaranteed to be delivered if the future is polled to completion.

impl<A, S, R> Dispatcher<A> for Store<S, R> where
    S: Reducer<A>,
    R: Reactor<S>, 
[src]

type Output = R::Output

fn dispatch(&mut self, action: A) -> R::Output[src]

Updates the state via Reducer<A>::reduce and notifies the reactor, returning the result of calling Reactor<S>::react with a reference to the new state.

Loading content...