mbus_core/lib.rs
1//! # mbus-core
2//!
3//! `mbus-core` is the foundational crate for a Rust implementation of the Modbus protocol,
4//! designed with a focus on `no_std` compatibility for embedded systems while remaining
5//! flexible enough for standard environments.
6//!
7//! ## Features
8//!
9//! - **Protocol Agnostic**: Supports core logic for Modbus TCP, RTU, and ASCII.
10//! - **no_std Support**: Core data structures and logic do not require the standard library.
11//! - **Strongly Typed**: Leverages Rust's type system to ensure valid PDU/ADU construction.
12//! - **Extensible**: Provides traits for custom transport implementations and user-defined function codes.
13//!
14//! ## Module Structure
15//!
16//! - [`data_unit`]: Definitions for PDU (Protocol Data Unit) and ADU (Application Data Unit).
17//! - [`errors`]: Centralized error handling for the Modbus stack.
18//! - [`function_codes`]: Definitions for public and user-defined Modbus function codes.
19//! - [`models`]: Modbus data models (feature-gated where applicable).
20//! - [`transport`]: Traits and configurations for physical/link layer communication.
21//!
22//! ## Usage
23//!
24//! This crate is typically used as a dependency for specific transport implementations like `mbus-network`
25//! or `mbus-rtu`, or by users implementing custom Modbus devices.
26#![cfg_attr(not(doc), no_std)]
27#![warn(missing_docs)]
28
29pub mod data_unit;
30pub mod errors;
31pub mod function_codes;
32pub mod models;
33pub mod transport;