Skip to main content

IntoHandler

Trait IntoHandler 

Source
pub trait IntoHandler<S: AppState, A> {
    // Required method
    fn call<'a, 'b, 'c>(
        &self,
        state: &mut S,
        action: A,
        ctx: &mut ReducerContext<'a, 'b, 'c, S>,
    );
}
Expand description

Trait that allows both 2-argument (legacy) and 3-argument (modern) handler functions to be used with ActionRegistry::register and BuildCtx::bind.

Required Methods§

Source

fn call<'a, 'b, 'c>( &self, state: &mut S, action: A, ctx: &mut ReducerContext<'a, 'b, 'c, S>, )

Invoke the handler with the given state, action, and context.

Implementations on Foreign Types§

Source§

impl<S: AppState, A> IntoHandler<S, A> for fn(&mut S, A)

Source§

fn call<'a, 'b, 'c>( &self, state: &mut S, action: A, _ctx: &mut ReducerContext<'a, 'b, 'c, S>, )

Source§

impl<S: AppState, A> IntoHandler<S, A> for for<'a, 'b, 'c> fn(&mut S, A, &mut ReducerContext<'a, 'b, 'c, S>)

Source§

fn call<'a, 'b, 'c>( &self, state: &mut S, action: A, ctx: &mut ReducerContext<'a, 'b, 'c, S>, )

Implementors§