1#![allow(
10 clippy::missing_safety_doc,
11 clippy::module_inception,
12 clippy::needless_doctest_main,
13 clippy::self_named_constructors,
14 clippy::should_implement_trait
15)]
16#![cfg_attr(not(feature = "std"), no_std)]
17#![cfg_attr(feature = "nightly", feature(allocator_api))]
18
19#[cfg(feature = "alloc")]
20extern crate alloc;
21
22#[macro_use]
23mod macros {
24 #[macro_use]
25 pub(crate) mod seal;
26 #[macro_use]
27 pub(crate) mod state;
28}
29
30#[doc(inline)]
31pub use self::{error::*, state::State, traits::*, types::*};
32
33mod state;
34
35pub mod error;
36
37mod impls {
38 mod impl_state;
39 mod impl_state_ops;
40 mod impl_state_repr;
41
42 #[allow(deprecated)]
43 mod impl_state_deprecated;
44}
45
46pub mod traits {
47 #[doc(inline)]
49 pub use self::prelude::*;
50
51 mod halting;
52 mod raw_state;
53 mod stateful;
54
55 mod prelude {
56 #[doc(inline)]
57 pub use super::halting::*;
58 #[doc(inline)]
59 pub use super::raw_state::*;
60 #[doc(inline)]
61 pub use super::stateful::*;
62 }
63}
64
65pub mod types {
66 #[doc(inline)]
68 pub use self::prelude::*;
69
70 mod halter;
71
72 mod prelude {
73 #[doc(inline)]
74 pub use super::aliases::*;
75 #[doc(inline)]
76 pub use super::halter::*;
77 }
78
79 mod aliases {
80 use crate::state::State;
81 #[cfg(feature = "alloc")]
82 pub type AnyState = State<alloc::boxed::Box<dyn core::any::Any>>;
85 pub type MaybeState<Q = bool> = State<core::mem::MaybeUninit<Q>>;
88 #[cfg(feature = "alloc")]
89 pub type SharedState<Q> = State<alloc::sync::Arc<Q>>;
90 #[cfg(feature = "std")]
91 pub type ShardState<Q> = State<std::sync::Arc<std::sync::Mutex<Q>>>;
92 pub type RefState<'a, Q> = State<&'a Q>;
94 pub type MutState<'a, Q> = State<&'a mut Q>;
97 pub type PtrState<Q> = State<*mut Q>;
99 }
100}
101
102#[doc(hidden)]
103pub mod prelude {
104 pub use crate::state;
105 #[doc(no_inline)]
106 pub use crate::state::*;
107 #[doc(no_inline)]
108 pub use crate::traits::*;
109 #[doc(no_inline)]
110 pub use crate::types::*;
111}