Skip to main content

bacnet_encoding/
lib.rs

1#![doc = include_str!("../README.md")]
2// Tests always build with std, so feature-off test runs need no imports of
3// their own.
4#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
5#![forbid(unsafe_code)]
6
7// `format!` and `vec!` without std's prelude. Without `alloc` the crate
8// links no allocator at all (#1614).
9#[cfg(feature = "alloc")]
10#[macro_use]
11extern crate alloc;
12
13/// Items only the `alloc` profile has: each gets `#[cfg(feature = "alloc")]`.
14macro_rules! alloc_only {
15    ($($item:item)*) => {
16        $(
17            #[cfg(feature = "alloc")]
18            $item
19        )*
20    };
21}
22
23pub mod apdu;
24pub mod constructed;
25#[cfg(feature = "alloc")]
26pub mod npdu;
27pub mod primitives;
28#[cfg(feature = "alloc")]
29pub mod segmentation;
30pub mod sink;
31pub mod tags;
32
33#[cfg(all(test, feature = "alloc"))]
34mod tags_canonical_tests;