awint/
lib.rs

1//! This crate compiles all the interfaces of `awint_core`, `awint_macros`, and
2//! `awint_ext` (when the default "alloc" feature is enabled). Enabling the
3//! "dag" feature flag also enables the `dag` module and a reexport of
4//! `awint_dag`. There are also hidden developer reexports.
5
6#![cfg_attr(not(feature = "std"), no_std)]
7#![cfg_attr(feature = "const_support", feature(const_trait_impl))]
8
9#[doc(hidden)]
10pub use awint_core::awint_internals;
11pub use awint_core::{bw, Bits, InlAwi, SerdeError};
12#[cfg(feature = "dag")]
13pub use awint_dag;
14#[cfg(feature = "alloc")]
15pub use awint_ext::{Awi, ExtAwi, FPType, OrdBits, FP};
16#[doc(hidden)]
17#[cfg(feature = "std")]
18pub use awint_macro_internals;
19pub use awint_macros::*;
20
21// This is located here because of issues with rustdoc
22/// Macro documentation
23pub mod macro_docs;
24
25/// Reexports all the regular arbitrary width integer structs, macros, common
26/// enums, and most of `core::primitive::*`.
27///
28/// This is useful for glob importing everything or for when using the regular
29/// items in a context with structs imported from `awint_dag`.
30pub mod awi {
31    #[cfg(not(feature = "alloc"))]
32    pub use awint_core::awi::*;
33    #[cfg(feature = "alloc")]
34    pub use awint_ext::awi::*;
35    pub use awint_macros::*;
36    pub use Option::{None, Some};
37    pub use Result::{Err, Ok};
38}
39
40/// Reexports all the mimicking versions of `awi` items
41#[cfg(feature = "dag")]
42pub mod dag {
43    pub use awint_dag::dag::{
44        Option::{None, Some},
45        Result::{Err, Ok},
46        *,
47    };
48}
49
50/// Reexports items defined within the `awint` crate system
51pub mod prelude {
52    pub use awint_core::{bw, Bits, InlAwi};
53    #[cfg(feature = "alloc")]
54    pub use awint_ext::{Awi, ExtAwi, FPType, FP};
55    pub use awint_macros::*;
56}
57
58/// Fixed point related items
59#[cfg(feature = "alloc")]
60pub mod fp {
61    pub use awint_ext::fp::*;
62}