#[repr(C)]pub enum Halt<Q = usize, H = Q>{
Halt(H),
Step(Q),
}Expand description
The Halt implementation is a binary enum designed to represent either a halting state
or a stepping state within a Turing machine or similar computational model.
Variants§
Implementations§
Source§impl<Q, H> Halt<Q, H>
impl<Q, H> Halt<Q, H>
Sourcepub const fn from_halt(state: H) -> Halt<Q, H>
pub const fn from_halt(state: H) -> Halt<Q, H>
Creates a new instance of a Halt with a halted state.
Sourcepub const fn from_state(state: Q) -> Halt<Q, H>
pub const fn from_state(state: Q) -> Halt<Q, H>
Creates a new instance of a Halt with a continuing state.
Sourcepub const fn swap(&mut self, other: &mut Halt<Q, H>)
pub const fn swap(&mut self, other: &mut Halt<Q, H>)
swap the inner value of the halt state with that of the given state.
Sourcepub const fn view(&self) -> Halt<&Q, &H>
pub const fn view(&self) -> Halt<&Q, &H>
returns a new instance of the halt state containing a reference to its inner value.
Source§impl<Q> Halt<Q>where
Q: RawState,
impl<Q> Halt<Q>where
Q: RawState,
Sourcepub fn into_inner(self) -> Q
pub fn into_inner(self) -> Q
consumes the current haltable state, returning the inner state.
Sourcepub fn into_state(self) -> State<Q>
pub fn into_state(self) -> State<Q>
consumes the current haltable state, returning the inner state.
Sourcepub fn into_halt_state(self) -> State<Halt<Q>>
pub fn into_halt_state(self) -> State<Halt<Q>>
consumes the current instance to initialize a wrapper instance
Sourcepub const fn as_halt_state(&self) -> State<Halt<&Q>>
pub const fn as_halt_state(&self) -> State<Halt<&Q>>
returns a wrapped instance of the halt state containing a reference to its inner value.
Sourcepub const fn as_mut_halt_state(&mut self) -> State<Halt<&mut Q>>
pub const fn as_mut_halt_state(&mut self) -> State<Halt<&mut Q>>
returns a wrapped instance of the halt state containing a mutable reference to its inner value.
Sourcepub const fn as_mut_state(&mut self) -> State<&mut Q>
pub const fn as_mut_state(&mut self) -> State<&mut Q>
returns a wrapped mutable reference to the inner value