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; // impl_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 iif; // iif!
35mod impl_trait; // impl_trait!
36mod items; // items!, sf!
37mod include; // include_from!, mod_from!
38mod maybe; // maybe!
39mod paste; // paste! wrapped for docs
40mod r#const; // CONST!
41mod reexports; // re-exported items
42
43#[cfg(_bit··)]
44mod enumset; // enumset!
45#[cfg(feature = "_unroll")]
46mod unroll; // unroll!
47
48crate::items! { // structural access: _mods, _internals, _all, _always
49 #[allow(unused)]
50 pub use {_mods::*, _internals::*};
51 #[allow(unused)] #[doc(hidden, no_inline)]
52 pub use _always::*;
53
54 mod _mods {
55 pub use super::{
56 asserts::_all::*, capture::*, cdbg::*, cfg_if::*, cfor::*, deprecate::*, ident::*,
57 iif::*, impl_trait::*, include::*, items::*, maybe::*, paste::*, r#const::*,
58 reexports::*,
59 };
60 #[cfg(_bit··)]
61 pub use super::enumset::*;
62 #[cfg(feature = "_unroll")]
63 pub use super::unroll::_all::*;
64 // WIPZONE
65 // #[cfg(all(feature = "std", feature = "dep_image"))]
66 // pub use super::docima::*;
67 }
68 pub(super) mod _internals {
69 pub(crate) use super::{_doc::*, _reexport::*, _use::*, error::*};
70 }
71 pub(super) mod _all {
72 #[doc(inline)]
73 pub use super::_mods::*;
74 }
75 pub(super) mod _always { #![allow(unused)]
76 pub use super::{_internals::*, reexports::*, error::*};
77 }
78}
79// WIPZONE
80// #[cfg(all(feature = "std", feature = "dep_image"))]
81// #[cfg_attr(feature = "nightly_doc", doc(cfg(all(feature = "std", feature = "dep_image"))))]
82// mod docima; // DocImage