pub struct SimpleLoggerMiddleware { /* private fields */ }
Available on crate feature
simple_logger
only.Expand description
Logging Middleware which uses the log macros to publish actions/events that occur within the Store.
See simple_logger for more details.
Implementations§
Trait Implementations§
Source§impl Default for SimpleLoggerMiddleware
impl Default for SimpleLoggerMiddleware
Source§impl<State, Action, Event, Effect> Middleware<State, Action, Event, Effect> for SimpleLoggerMiddleware
impl<State, Action, Event, Effect> Middleware<State, Action, Event, Effect> for SimpleLoggerMiddleware
Source§fn on_reduce(
&self,
store: &Store<State, Action, Event, Effect>,
action: Option<&Action>,
reduce: ReduceFn<State, Action, Event, Effect>,
) -> ReduceMiddlewareResult<Event, Effect>
fn on_reduce( &self, store: &Store<State, Action, Event, Effect>, action: Option<&Action>, reduce: ReduceFn<State, Action, Event, Effect>, ) -> ReduceMiddlewareResult<Event, Effect>
This method is invoked by the Store during a
Store::dispatch() just before the
Action
is sent to the
Reducer. It is necessary to call the
provided reduce
function, which executes subsequent
middleware and runs the Reducer, and usually
the events produced by the reduce
function are returned from
this method. Read moreSource§fn process_effect(
&self,
_store: &Store<State, Action, Event, Effect>,
effect: Effect,
) -> Option<Effect>
fn process_effect( &self, _store: &Store<State, Action, Event, Effect>, effect: Effect, ) -> Option<Effect>
Process an
Effect
. Returns None
if the effect was
processed/consumed by this handler, otherwise returns
Some(effect)
.Source§fn on_notify(
&self,
store: &Store<State, Action, Event, Effect>,
events: Vec<Event>,
notify: NotifyFn<State, Action, Event, Effect>,
) -> Vec<Event>
fn on_notify( &self, store: &Store<State, Action, Event, Effect>, events: Vec<Event>, notify: NotifyFn<State, Action, Event, Effect>, ) -> Vec<Event>
This method is invoked by the Store during a
Store::dispatch() after the Reducer has
processed the
Action
and all Middleware::on_reduce()
methods have completed, just before resulting events are
sent to the store listeners. It is necessary to call the
provided notify
function, which executes subsequent
middleware and then notifies the listeners. Read moreAuto Trait Implementations§
impl Freeze for SimpleLoggerMiddleware
impl RefUnwindSafe for SimpleLoggerMiddleware
impl Send for SimpleLoggerMiddleware
impl Sync for SimpleLoggerMiddleware
impl Unpin for SimpleLoggerMiddleware
impl UnwindSafe for SimpleLoggerMiddleware
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, V> IntoOptPropValue<V> for Twhere
T: IntoPropValue<Option<V>>,
impl<T, V> IntoOptPropValue<V> for Twhere
T: IntoPropValue<Option<V>>,
Source§fn into_opt_prop_value(self) -> Option<V>
fn into_opt_prop_value(self) -> Option<V>
Convert
self
to an optional value of a Properties
struct.Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.