rstm_core/
lib.rs

1/*
2    Appellation: rstm-core <library>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5//! The core modules for the `rstm` framework, providing a suite of fundamental abstractions
6//! and primitives for creating and managing state machines and related constructs.
7#![allow(
8    clippy::missing_safety_doc,
9    clippy::module_inception,
10    clippy::needless_doctest_main,
11    clippy::self_named_constructors,
12    clippy::should_implement_trait
13)]
14#![cfg_attr(not(feature = "std"), no_std)]
15#![cfg_attr(feature = "nightly", feature(allocator_api))]
16
17#[cfg(feature = "alloc")]
18extern crate alloc;
19
20#[doc(inline)]
21pub use rstm_state as state;
22
23#[doc(inline)]
24pub use self::{
25    error::{Error, Result},
26    head::*,
27    rule::{LearnedRule, Rule},
28    state::{RawState, State},
29    tail::*,
30    traits::*,
31    types::prelude::*,
32    utils::*,
33};
34
35#[macro_use]
36pub(crate) mod macros {
37    #[macro_use]
38    pub mod seal;
39}
40
41pub mod error;
42pub mod head;
43pub mod rule;
44pub mod tail;
45
46pub mod traits {
47    /// this modules provides various traits used throughout the library
48    pub use self::prelude::*;
49
50    mod convert;
51    mod increment;
52    mod instruction;
53    mod symbols;
54
55    pub(crate) mod prelude {
56        #[doc(inline)]
57        pub use super::convert::*;
58        #[doc(inline)]
59        pub use super::increment::*;
60        #[doc(inline)]
61        pub use super::instruction::*;
62        #[doc(inline)]
63        pub use super::symbols::*;
64    }
65}
66
67pub mod types {
68    //! The core types used throughout the library such as the [`Direction`] enum
69    #[doc(inline)]
70    pub use self::prelude::*;
71
72    pub mod direction;
73
74    pub(crate) mod prelude {
75        #[doc(inline)]
76        pub use super::direction::Direction;
77    }
78}
79
80pub mod utils {
81    //! useful utilities for managing and creating Turing machines and related constructs
82    #[doc(inline)]
83    pub use self::prelude::*;
84
85    mod bounds;
86
87    pub mod prelude {
88        #[doc(inline)]
89        pub use super::bounds::*;
90    }
91}
92
93#[doc(hidden)]
94pub mod prelude {
95    #[doc(no_inline)]
96    pub use rstm_state::prelude::*;
97
98    pub use crate::head::*;
99    pub use crate::rule::*;
100    pub use crate::tail::*;
101
102    pub use crate::traits::*;
103    pub use crate::types::prelude::*;
104    pub use crate::utils::*;
105}