pub struct Halt<Q>(pub Q);
Tuple Fields§
§0: Q
Implementations§
Source§impl<Q> Halt<Q>
impl<Q> Halt<Q>
pub fn new(halt: Q) -> Self
Sourcepub const fn get_ref(&self) -> &Q
pub const fn get_ref(&self) -> &Q
Returns an immutable reference to the inner value of the halted state.
Sourcepub fn get_mut(&mut self) -> &mut Q
pub fn get_mut(&mut self) -> &mut Q
Returns a mutable reference to the inner value of the halted state.
Sourcepub fn replace(&mut self, halt: Q) -> Q
pub fn replace(&mut self, halt: Q) -> Q
Replaces the inner value of the halted state with the given value, returning the previous value.
Sourcepub fn reset(&mut self)where
Q: Default,
pub fn reset(&mut self)where
Q: Default,
Resets the inner value of the halted state to the default value of the type.
Sourcepub fn set(&mut self, halt: Q)
pub fn set(&mut self, halt: Q)
Sets the inner value of the halted state to that of the given value.
Sourcepub fn swap<S>(&mut self, other: &mut S)where
S: Stated<Item = Q>,
pub fn swap<S>(&mut self, other: &mut S)where
S: Stated<Item = Q>,
Swaps the inner value of the halted state with that of the given state.
Sourcepub fn take(&mut self) -> Qwhere
Q: Default,
pub fn take(&mut self) -> Qwhere
Q: Default,
Takes the inner value of the halted state and replaces it with the default value of the type.
Sourcepub fn as_state(&self) -> State<Halt<&Q>>
pub fn as_state(&self) -> State<Halt<&Q>>
Converts the halted state into a new State with an immutable reference to the inner value.
Sourcepub fn as_state_mut(&mut self) -> State<Halt<&mut Q>>
pub fn as_state_mut(&mut self) -> State<Halt<&mut Q>>
Converts the halted state into a new State with a mutable reference to the inner value.
Sourcepub fn into_state(self) -> State<Halt<Q>>
pub fn into_state(self) -> State<Halt<Q>>
Wraps the halted state and returns a new State