1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Implementations of composite types that span multiple registers.
use BinRead;
use crateValue;
/// Trivial implementation for `u16`, it's just read natively from Modbus in big-endian.
/// Trivial implementation for `i16`, it's just read natively from Modbus in big-endian.
/// [`i32`] composed of two words in big-endian ordering.
///
/// It's a trivial implementation since two big-endian words in big-endian is just [`i32`] in big-endian.
///
/// # Example
///
/// ```rust
/// use fennec_modbus::protocol::{function::read_registers::BigEndianI32, r#struct::Readable};
/// assert_eq!(i32::from(BigEndianI32::from_bytes(&[0xFF, 0xFF, 0xFF, 0xFE])?), -2);
/// # Ok::<_, anyhow::Error>(())
/// ```
;
/// [`u32`] composed of two words in big-endian ordering.
///
/// It's a trivial implementation since two big-endian words in big-endian is just [`u32`] in big-endian.
;