pub struct MbapHeader {
pub transaction_id: u16,
pub protocol_id: u16,
pub length: u16,
pub unit_id: u8,
}Expand description
Modbus TCP Application Data Unit (ADU) Header (MBAP).
Fields§
§transaction_id: u16Identification of a Modbus Request/Response transaction.
protocol_id: u16Protocol Identifier (0 = Modbus protocol).
length: u16Number of remaining bytes in the message (Unit ID + PDU).
unit_id: u8Identification of a remote server on a non-TCP/IP network.
Implementations§
Source§impl MbapHeader
impl MbapHeader
Sourcepub fn new(transaction_id: u16, length: u16, unit_id: u8) -> Self
pub fn new(transaction_id: u16, length: u16, unit_id: u8) -> Self
Creates a new MbapHeader instance.
§Arguments
transaction_id- The transaction ID for the Modbus message.protocol_id- The protocol identifier (should be 0 for Modbus).length- The length of the remaining message (Unit ID + PDU).unit_id- The unit identifier for the target slave device.
§Returns
A new MbapHeader instance.
Trait Implementations§
Source§impl Clone for MbapHeader
impl Clone for MbapHeader
Source§fn clone(&self) -> MbapHeader
fn clone(&self) -> MbapHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MbapHeader
impl Debug for MbapHeader
impl Copy for MbapHeader
Auto Trait Implementations§
impl Freeze for MbapHeader
impl RefUnwindSafe for MbapHeader
impl Send for MbapHeader
impl Sync for MbapHeader
impl Unpin for MbapHeader
impl UnsafeUnpin for MbapHeader
impl UnwindSafe for MbapHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more