Skip to main content

mbus_core/data_unit/
mod.rs

1//! Modbus Data Unit Module
2//!
3//! This module provides the core data structures for Modbus communication,
4//! encompassing both the Protocol Data Unit (PDU) and the Application Data Unit (ADU).
5//!
6//! It is organized into two primary sub-modules:
7//! - [`common`]: Contains the transport-agnostic [`Pdu`] and the generic [`ModbusMessage`]
8//!   structures used across TCP, RTU, and ASCII variants.
9//! - [`tcp`]: Specifically handles the Modbus TCP implementation, including the
10//!   MBAP (Modbus Application Protocol) header and TCP-specific ADU serialization.
11//!
12//! The data unit logic is designed to be `no_std` compatible, leveraging `heapless`
13//! for deterministic memory management, which is critical for embedded systems
14//! where dynamic allocation is often restricted.
15
16pub mod common;