pub struct ReadHoldingRegistersRequest {
pub address: Address,
pub quantity: Quantity,
}Expand description
FC 0x03 — Read Holding Registers request.
Reads 1..=125 contiguous holding registers starting at address.
Fields§
§address: AddressStarting address (0-indexed).
quantity: QuantityNumber of registers to read (1..=125).
Implementations§
Source§impl ReadHoldingRegistersRequest
impl ReadHoldingRegistersRequest
Sourcepub fn decode(data: &[u8]) -> Result<Self, DecodeError>
pub fn decode(data: &[u8]) -> Result<Self, DecodeError>
Decode from PDU data after the function code byte.
§Errors
Returns DecodeError::Truncated if data is shorter than 4 bytes.
Returns DecodeError::LengthMismatch if data has extra bytes.
Returns DecodeError::QuantityOutOfRange if the quantity is not in 1..=125.
Trait Implementations§
Source§impl Clone for ReadHoldingRegistersRequest
impl Clone for ReadHoldingRegistersRequest
Source§fn clone(&self) -> ReadHoldingRegistersRequest
fn clone(&self) -> ReadHoldingRegistersRequest
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 moreimpl Copy for ReadHoldingRegistersRequest
Source§impl Debug for ReadHoldingRegistersRequest
impl Debug for ReadHoldingRegistersRequest
Source§impl Encode for ReadHoldingRegistersRequest
impl Encode for ReadHoldingRegistersRequest
Source§fn encode_into(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
fn encode_into(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Write the full PDU (function code + data) into
buf. Read moreSource§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Total encoded length in bytes (including the function code byte).
impl Eq for ReadHoldingRegistersRequest
Source§impl PartialEq for ReadHoldingRegistersRequest
impl PartialEq for ReadHoldingRegistersRequest
Source§fn eq(&self, other: &ReadHoldingRegistersRequest) -> bool
fn eq(&self, other: &ReadHoldingRegistersRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReadHoldingRegistersRequest
Auto Trait Implementations§
impl Freeze for ReadHoldingRegistersRequest
impl RefUnwindSafe for ReadHoldingRegistersRequest
impl Send for ReadHoldingRegistersRequest
impl Sync for ReadHoldingRegistersRequest
impl Unpin for ReadHoldingRegistersRequest
impl UnsafeUnpin for ReadHoldingRegistersRequest
impl UnwindSafe for ReadHoldingRegistersRequest
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