Expand description
The state module provides abstractions and implementations for managing state
within the rstm framework.
Modules§
- error
- This module defines the custom error type for handling various state-related errors.
Macros§
Structs§
- State
- The
Statewrapper is a generic container used to denote objects being used as a state in a Turing machine, finite-state machine, or similar computational model.
Enums§
- Halt
- The
Haltimplementation is a binary enum designed to represent either a halting state or a stepping state within a Turing machine or similar computational model. - State
Error - the various errors that can occur in the state module
Traits§
- Halting
- The
Haltingtrait establishes an interface for determining whether a given state is in a halted condition. This trait is essential for Turing machine simulations, as it allows for the identification of states that signify the end of computation. - Halting
State - The
HaltingStatetrait is used to define states that are capable of representing halting conditions within a Turing machine simulation. For instance, if our state is of typeisize, then we might define<isize>::MAXto represent a halting state. - Hash
State - The
HashStatetrait extends theRawStatetrait to include hashing capabilities, streamlining the process of using states as keys in hash maps or sets. - Into
State IntoStatedefines a conversion consuming the caller and transforming into aStateof typeQ.- NumState
- The
NumStatetrait extends theRawStatetrait to include numeric operations. - RawState
RawStateis a sealed marker trait used to define objects used to represent states. The primary benefit of such a trait is preventing cases where theStateimplementation is used as a state itself:State<State<Q>>.- State
Ext - The
StateExttrait is used to extend the baseRawStatetrait, introducing additional traits and constraints that are commonly required for state representations. - Stateful
Statefulis a trait used to establish an interface for objects that maintain theor own internal state.
Type Aliases§
- AnyState
- A type alias for a State whose inner value is the dynamically sized type of a boxed
Any. - Control
State - A type alias for a
Stateinstance configured to leverage theControlFlowenum as its inner type. This is a useful shortcut for representing a halt state. - Halt
State - A type alias for a
Stateequipped with the dedicatedHaltenum as its inner type. - Maybe
State - A
Statealias allowing potentially uninitialized inner values using theMaybeUninitimplementation. - Option
State - A state whose halting value is defined by the
Nonevariant. - Result
- A type alias for a
Resultthat uses the customStateErrortype