Skip to main content

rusty_modbus_server/
error.rs

1//! Server error types.
2
3use rusty_modbus_tcp::TransportError;
4
5/// Errors that can occur during server operations.
6#[derive(Debug, thiserror::Error)]
7pub enum ServerError {
8    /// Transport-level error (I/O, framing).
9    #[error("transport error: {0}")]
10    Transport(#[from] TransportError),
11
12    /// Failed to bind the listen address.
13    #[error("bind failed: {0}")]
14    Bind(std::io::Error),
15
16    /// Server is already running.
17    #[error("server is already running")]
18    AlreadyRunning,
19}