pub struct WriteSingleCoilResponse {
pub address: Address,
pub value: CoilValue,
}Expand description
Response to a Write Single Coil request (FC 0x05).
This is an echo of the request.
Fields§
§address: AddressAddress of the coil that was written.
value: CoilValueValue that was written to the coil.
Implementations§
Source§impl WriteSingleCoilResponse
impl WriteSingleCoilResponse
Sourcepub fn decode(data: &[u8]) -> Result<Self, DecodeError>
pub fn decode(data: &[u8]) -> Result<Self, DecodeError>
Decode from the data bytes following the function code.
§Errors
Returns DecodeError::Truncated if data is too short.
Returns DecodeError::LengthMismatch if data has extra bytes.
Returns DecodeError::InvalidCoilValue if the coil value is not
0xFF00 or 0x0000.
Trait Implementations§
Source§impl Debug for WriteSingleCoilResponse
impl Debug for WriteSingleCoilResponse
Source§impl Encode for WriteSingleCoilResponse
impl Encode for WriteSingleCoilResponse
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).
Auto Trait Implementations§
impl Freeze for WriteSingleCoilResponse
impl RefUnwindSafe for WriteSingleCoilResponse
impl Send for WriteSingleCoilResponse
impl Sync for WriteSingleCoilResponse
impl Unpin for WriteSingleCoilResponse
impl UnsafeUnpin for WriteSingleCoilResponse
impl UnwindSafe for WriteSingleCoilResponse
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