Skip to main content

Crate rstm_state

Crate rstm_state 

Source
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§

s
the s! macro is a simple helper macro to create a State instance.

Structs§

State
The State wrapper 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 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.
StateError
the various errors that can occur in the state module

Traits§

Halting
The Halting trait 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.
HaltingState
The HaltingState trait is used to define states that are capable of representing halting conditions within a Turing machine simulation. For instance, if our state is of type isize, then we might define <isize>::MAX to represent a halting state.
HashState
The HashState trait extends the RawState trait to include hashing capabilities, streamlining the process of using states as keys in hash maps or sets.
IntoState
IntoState defines a conversion consuming the caller and transforming into a State of type Q.
NumState
The NumState trait extends the RawState trait to include numeric operations.
RawState
RawState is a sealed marker trait used to define objects used to represent states. The primary benefit of such a trait is preventing cases where the State implementation is used as a state itself: State<State<Q>>.
StateExt
The StateExt trait is used to extend the base RawState trait, introducing additional traits and constraints that are commonly required for state representations.
Stateful
Stateful is 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.
ControlState
A type alias for a State instance configured to leverage the ControlFlow enum as its inner type. This is a useful shortcut for representing a halt state.
HaltState
A type alias for a State equipped with the dedicated Halt enum as its inner type.
MaybeState
A State alias allowing potentially uninitialized inner values using the MaybeUninit implementation.
OptionState
A state whose halting value is defined by the None variant.
Result
A type alias for a Result that uses the custom StateError type