pub struct WebLoggerMiddleware { /* private fields */ }
Available on crate feature
web_logger
only.Expand description
Logging middleware for applications running in the browser.
See web_logger for more details.
Implementations§
Source§impl WebLoggerMiddleware
impl WebLoggerMiddleware
pub fn new() -> Self
Sourcepub fn log_level(self, log_level: LogLevel) -> Self
pub fn log_level(self, log_level: LogLevel) -> Self
Set the level at which the data from this middleware will be logged to.
Sourcepub fn display_type(self, display_type: DisplayType) -> Self
pub fn display_type(self, display_type: DisplayType) -> Self
What type of display to use when printing the data from this middleware.
Trait Implementations§
Source§impl Default for WebLoggerMiddleware
impl Default for WebLoggerMiddleware
Source§impl<State, Action, Event, Effect> Middleware<State, Action, Event, Effect> for WebLoggerMiddleware
impl<State, Action, Event, Effect> Middleware<State, Action, Event, Effect> for WebLoggerMiddleware
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 WebLoggerMiddleware
impl RefUnwindSafe for WebLoggerMiddleware
impl Send for WebLoggerMiddleware
impl Sync for WebLoggerMiddleware
impl Unpin for WebLoggerMiddleware
impl UnwindSafe for WebLoggerMiddleware
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.