Skip to main content

bacnet_services/
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// Without `alloc` the crate links no allocator at all (#1614). The library
8// builds no `format!` text (#1802).
9#[cfg(feature = "alloc")]
10extern crate alloc;
11
12/// Items only the `alloc` profile has: each gets `#[cfg(feature = "alloc")]`.
13macro_rules! alloc_only {
14    ($($item:item)*) => {
15        $(
16            #[cfg(feature = "alloc")]
17            $item
18        )*
19    };
20}
21
22// Who-Is, I-Am and ReadProperty encode and decode without an allocator.
23pub mod read_property;
24pub mod who_is;
25
26alloc_only! {
27    pub mod alarm_event;
28    pub mod alarm_summary;
29    pub mod audit;
30    pub mod common;
31    pub mod cov;
32    mod cov_decode;
33    pub mod cov_multiple;
34    pub mod device_mgmt;
35    pub mod enrollment_summary;
36    pub mod file;
37    pub mod life_safety;
38    pub mod list_manipulation;
39    pub mod object_mgmt;
40    pub mod private_transfer;
41    pub mod read_range;
42    pub mod rpm;
43    pub mod structured_error;
44    pub mod text_message;
45    pub mod virtual_terminal;
46    pub mod who_am_i;
47    pub mod who_has;
48    pub mod wpm;
49    pub mod write_group;
50    pub mod write_property;
51}
52
53#[cfg(all(test, feature = "alloc"))]
54mod malformed_member_tests;
55#[cfg(all(test, feature = "alloc"))]
56mod reject_reason_tests;
57#[cfg(all(test, feature = "alloc"))]
58mod truncated_member_tests;