Struct composable::Store
source · pub struct Store<State: Reducer> { /* private fields */ }
Expand description
The state container for the application.
§Threading
Implementations§
source§impl<State: Reducer> Store<State>
impl<State: Reducer> Store<State>
sourcepub fn with_initial(state: State) -> Self
pub fn with_initial(state: State) -> Self
sourcepub fn new<F>(with: F) -> Self
pub fn new<F>(with: F) -> Self
Creates a new Store
with its initial state generated by a function.
Useful if State
is not Send
, but the arguments used to construct it are.
sourcepub fn send(&self, action: impl Into<<State as Reducer>::Action>)
pub fn send(&self, action: impl Into<<State as Reducer>::Action>)
Calls the Store
’s Reducer
with action
.
Takes an Into<Action>
so that both child and parent Action
s may be sent easily.
sourcepub fn into_inner(self) -> <State as Reducer>::Output
pub fn into_inner(self) -> <State as Reducer>::Output
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for Store<State>
impl<State> !RefUnwindSafe for Store<State>
impl<State> Send for Store<State>
impl<State> Sync for Store<State>
impl<State> Unpin for Store<State>
impl<State> !UnwindSafe for Store<State>
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