scsys_core/
lib.rs

1/*
2    Appellation: scsys-core <library>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5//! This crate works to provide a set of utilities for working with state, time, and synchronization in Rust.
6#![cfg_attr(not(feature = "std"), no_std)]
7
8#[cfg(feature = "alloc")]
9extern crate alloc;
10
11#[macro_use]
12pub(crate) mod macros {
13    #[macro_use]
14    pub mod builder;
15    #[macro_use]
16    pub mod fmt;
17    #[macro_use]
18    pub mod gsw;
19    #[macro_use]
20    pub mod seal;
21    #[macro_use]
22    pub mod wrapper;
23}
24
25#[doc(inline)]
26pub use self::{
27    error::*,
28    state::{NState, RawState, State, Stateful},
29    types::prelude::*,
30    utils::*,
31};
32
33pub(crate) mod utils;
34
35pub mod error;
36pub mod id;
37pub mod state;
38pub mod time;
39
40pub mod types {
41    #[doc(inline)]
42    pub use self::prelude::*;
43
44    pub mod direction;
45
46    pub(crate) mod prelude {
47        #[allow(unused_imports)]
48        #[doc(inline)]
49        pub use super::aliases::*;
50        #[doc(inline)]
51        pub use super::direction::*;
52    }
53
54    pub(crate) mod aliases {
55        #[cfg(feature = "alloc")]
56        /// Type alias for a boxed error with send, sync, and static flags enabled
57        pub type BoxError = alloc::boxed::Box<dyn core::error::Error + Send + Sync + 'static>;
58        #[cfg(feature = "alloc")]
59        /// Type alias for the standard result used
60        pub type BoxResult<T = ()> = core::result::Result<T, BoxError>;
61        #[cfg(feature = "std")]
62        /// Type alias wrapping a locked, thread-safe structure with a [Mutex] in an [Arc]
63        pub type Arcm<T> = std::sync::Arc<std::sync::Mutex<T>>;
64        #[cfg(feature = "std")]
65        /// Type alias for [std::io::Result]
66        pub type IOResult<T = ()> = std::io::Result<T>;
67    }
68}
69
70pub mod prelude {
71    #[doc(no_inline)]
72    pub use crate::error::*;
73    #[doc(no_inline)]
74    pub use crate::id::prelude::*;
75    #[doc(no_inline)]
76    pub use crate::state::prelude::*;
77    #[doc(no_inline)]
78    pub use crate::time::prelude::*;
79    #[doc(no_inline)]
80    pub use crate::types::prelude::*;
81    #[doc(no_inline)]
82    pub use crate::utils::*;
83}