pub struct Store<S: State> { /* private fields */ }Expand description
Store manages state lifecycle with subscriptions and time-travel debugging.
Implementations§
Source§impl<S: State> Store<S>
impl<S: State> Store<S>
Sourcepub fn with_history_limit(initial: S, max_history: usize) -> Self
pub fn with_history_limit(initial: S, max_history: usize) -> Self
Create a store with custom history limit.
Sourcepub fn dispatch(&mut self, msg: S::Message) -> Command<S::Message>
pub fn dispatch(&mut self, msg: S::Message) -> Command<S::Message>
Dispatch a message to update state.
Sourcepub fn history_len(&self) -> usize
pub fn history_len(&self) -> usize
Get number of history entries.
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear history.
Auto Trait Implementations§
impl<S> Freeze for Store<S>where
S: Freeze,
impl<S> !RefUnwindSafe for Store<S>
impl<S> Send for Store<S>
impl<S> Sync for Store<S>
impl<S> Unpin for Store<S>where
S: Unpin,
impl<S> !UnwindSafe for Store<S>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more