devela/code/util/
mod.rs

1// devela::code::util
2//
3//! Utility macros and hint functions.
4//!
5#![doc = crate::doc_!(extends: hint)]
6//
7// # Implementation notes
8// Several macros are defined hidden, prefixed with `_`, an publicly re-exported
9// unprefixed. This fixes able to import them from the root.
10// See: <https://github.com/rust-lang/rust/pull/52234#issuecomment-976702997>
11// E.g.: bitfield, capture_last, CONST, enumset.
12//
13// # Documentation for declarative macros
14// - [The Little Book of Rust Macros](https://veykril.github.io/tlborm/decl-macros.html)
15// - [Macros By Example](https://doc.rust-lang.org/reference/macros-by-example.html)
16// - [Specification](https://doc.rust-lang.org/reference/macro-ambiguity.html)
17
18// private modules
19mod _doc; // doc_! // RENAME: _doc!
20mod _reexport; // reexport! // RENAME _reexport!
21mod _use; // _use!
22mod error; // define_error!
23
24#[doc(hidden)]
25pub use paste::__paste;
26
27mod asserts; // assertion macros
28mod capture; // capture_[first|last|tail]!
29mod cdbg; // cdbg!
30mod cfg_if; // cfg_if!
31mod cfor; // cfor!
32mod deprecate; // deprecate_feature!
33mod ident; // ident_const_index!
34mod is; // is!
35mod impl_trait; // impl_trait!
36mod items; // items!, sf!
37mod include; // include_from!, mod_from!
38mod maybe; // maybe!
39mod methods; // methods_as_fns
40mod paste; // paste! wrapped for docs
41mod r#const; // CONST!
42mod reexports; // re-exported items
43
44#[cfg(_bit··)]
45mod enumset; // enumset!
46#[cfg(feature = "_unroll")]
47mod unroll; // unroll!
48
49crate::items! { // structural access: _mods, _internals, _all, _always
50    #[allow(unused)]
51    pub use {_mods::*, _internals::*};
52    #[allow(unused)] #[doc(hidden, no_inline)]
53    pub use _always::*;
54
55    mod _mods {
56        pub use super::{
57            asserts::_all::*, capture::*, cdbg::*, cfg_if::*, cfor::*, deprecate::*, ident::*,
58            is::*, impl_trait::*, include::*, items::*, maybe::*, methods::*, paste::*, r#const::*,
59            reexports::*,
60        };
61        #[cfg(_bit··)]
62        pub use super::enumset::*;
63        #[cfg(feature = "_unroll")]
64        pub use super::unroll::_all::*;
65        // WIPZONE
66        // #[cfg(all(feature = "std", feature = "dep_image"))]
67        // pub use super::docima::*;
68    }
69    pub(super) mod _internals {
70        pub(crate) use super::{_doc::*, _reexport::*, _use::*, error::*};
71    }
72    pub(super) mod _all {
73        #[doc(inline)]
74        pub use super::_mods::*;
75    }
76    pub(super) mod _always { #![allow(unused)]
77        pub use super::{_internals::*, reexports::*, error::*};
78    }
79}
80// WIPZONE
81// #[cfg(all(feature = "std", feature = "dep_image"))]
82// #[cfg_attr(feature = "nightly_doc", doc(cfg(all(feature = "std", feature = "dep_image"))))]
83// mod docima; // DocImage