pub struct Transaction {
pub unit_id: u8,
pub function_code: FunctionCode,
pub start_address: u16,
pub register_count: u16,
}Expand description
A successfully completed Modbus request/response cycle.
Returned inside BridgeEvent::Transaction after
Connection::next successfully forwards a request
to the RTU device and relays the response back to the TCP client.
§Examples
ⓘ
if let BridgeEvent::Transaction(t) = conn.next().await? {
defmt::info!(
"unit={} fc={} addr={} count={}",
t.unit_id, t.function_code, t.start_address, t.register_count,
);
}Fields§
§unit_id: u8Modbus unit (slave) address from the request, in the range 1–247.
function_code: FunctionCodeFunction code identifying the type of operation requested.
start_address: u16Starting register or coil address (zero-based) from the request.
register_count: u16Number of registers or coils requested, or the output value for single-write function codes (FC 0x05, FC 0x06).
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Transaction
impl Debug for Transaction
Source§impl Display for Transaction
impl Display for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Transaction
impl Eq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
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