WebLoggerMiddleware

Struct WebLoggerMiddleware 

Source
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

Source

pub fn new() -> Self

Source

pub fn log_level(self, log_level: LogLevel) -> Self

Set the level at which the data from this middleware will be logged to.

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<State, Action, Event, Effect> Middleware<State, Action, Event, Effect> for WebLoggerMiddleware
where State: Serialize, Action: Serialize + Display, Event: Clone + Hash + Eq + Serialize, Effect: Serialize,

Source§

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 more
Source§

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>

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 more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, V> IntoOptPropValue<V> for T
where T: IntoPropValue<Option<V>>,

Source§

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

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Any for T
where T: Any,