pub struct Store<S: Debug + Clone + Default + PartialEq + Eq + 'static> { /* private fields */ }
Expand description

A global Store

The store holds global app app data with static lifetime.

It can be manipulated by dispatching actions (See Action).

Each action is handled by the reducer - A function which matches the action and has a mutable ref to the state in the store.

The reducer must not have any side effects (E.g. saving the state to a file).

Side effects are implemented in middlewares (See Middleware).

Implementations

Create a new Store.

Arguments
  • default_state: The initial state of the store.
  • reducer: The root reducer for this store.
  • middlewares: A list of Middleware.

Select a slice of the state where everything else is Default::default().

Select a slice of the state with receiving the whole state.

Dispatch the given arguments as an Action.

NOTE:

This is a placeholder since rustdoc server can not compile latest gtk yet The actual signature looks like this:

pub fn dispatch(&self, action: String, argument: Option<glib::Variant>)

Delegate GTK actions as gstore::Actions to this store.

NOTE:

This is a placeholder since rustdoc server can not compile latest gtk yet The actual signature looks like this:

pub fn delegate(&'static self) -> glib::Sender<(gdk4::gio::SimpleAction, Option<glib::Variant>)>

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.