#[non_exhaustive]pub struct ModeChange<M> {
pub target: M,
}Expand description
A requested change from one mode to another.
Produced inside a Decision when an event triggers a mode transition.
The runtime inspects this value to determine whether the system should
move to a new mode.
§Examples
use ready_active_safe::Decision;
let d: Decision<&str, (), ()> = Decision::transition("active");
let change = d.mode_change();
assert_eq!(change.map(|mc| mc.target), Some("active"));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.target: MThe mode to transition to.
Trait Implementations§
Source§impl<M: Clone> Clone for ModeChange<M>
impl<M: Clone> Clone for ModeChange<M>
Source§fn clone(&self) -> ModeChange<M>
fn clone(&self) -> ModeChange<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M: Debug> Debug for ModeChange<M>
impl<M: Debug> Debug for ModeChange<M>
Source§impl<M: PartialEq> PartialEq for ModeChange<M>
impl<M: PartialEq> PartialEq for ModeChange<M>
impl<M: Eq> Eq for ModeChange<M>
impl<M> StructuralPartialEq for ModeChange<M>
Auto Trait Implementations§
impl<M> Freeze for ModeChange<M>where
M: Freeze,
impl<M> RefUnwindSafe for ModeChange<M>where
M: RefUnwindSafe,
impl<M> Send for ModeChange<M>where
M: Send,
impl<M> Sync for ModeChange<M>where
M: Sync,
impl<M> Unpin for ModeChange<M>where
M: Unpin,
impl<M> UnsafeUnpin for ModeChange<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for ModeChange<M>where
M: 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