pub struct State<S: Eq + 'static> { /* private fields */ }Expand description
Host-owned state resource with explicit current, previous, and pending boundaries.
Implementations§
Source§impl<S: Eq + 'static> State<S>
impl<S: Eq + 'static> State<S>
Sourcepub fn new(initial: S) -> Self
pub fn new(initial: S) -> Self
Creates state with initial as Self::current and no pending transition.
Sourcepub fn previous(&self) -> Option<&S>
pub fn previous(&self) -> Option<&S>
Outgoing value from the most recent committed transition, if any.
Sourcepub fn transition_tick(&self) -> Option<ChangeTick>
pub fn transition_tick(&self) -> Option<ChangeTick>
ChangeTick recorded when the last transition committed.
Auto Trait Implementations§
impl<S> Freeze for State<S>where
S: Freeze,
impl<S> RefUnwindSafe for State<S>where
S: RefUnwindSafe,
impl<S> Send for State<S>where
S: Send,
impl<S> Sync for State<S>where
S: Sync,
impl<S> Unpin for State<S>where
S: Unpin,
impl<S> UnsafeUnpin for State<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for State<S>where
S: UnwindSafe,
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