modbius_core/
error.rs

1/// An error type describing what can happen when parsing Modbus data from bytes 
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
3pub enum ModbusSerializationError {
4    /// The input data didn't include enough bytes
5    UnexpectedEOF {
6        /// The number of expected bytes
7        expected: usize,
8        /// The number of bytes received
9        got: usize
10    },
11    /// The given output buffer was too small to receive all data
12    InsufficientBuffer {
13        /// The expected minimum size of the output buffer
14        expected: usize,
15        /// The size of the given output buffer
16        got: usize
17    },
18    /// An invalid value was encountered that can not be accepted.
19    InvalidValue,
20}