pub struct WriteMultipleCoilsRequest<'buf> {
pub address: Address,
pub quantity: Quantity,
pub byte_count: u8,
pub coil_values: &'buf [u8],
}Expand description
FC 0x0F — Write Multiple Coils request.
Writes 1..=1968 contiguous coils starting at address. Coil values are
packed as bits in coil_values, LSB of the first byte is the lowest address.
Fields§
§address: AddressStarting address (0-indexed).
quantity: QuantityNumber of coils to write (1..=1968).
byte_count: u8Number of data bytes that follow.
coil_values: &'buf [u8]Packed coil values (bit-packed, LSB first).
Implementations§
Source§impl<'buf> WriteMultipleCoilsRequest<'buf>
impl<'buf> WriteMultipleCoilsRequest<'buf>
Sourcepub fn decode(data: &'buf [u8]) -> Result<Self, DecodeError>
pub fn decode(data: &'buf [u8]) -> Result<Self, DecodeError>
Decode from PDU data after the function code byte.
§Errors
Returns DecodeError::Truncated if data is too short.
Returns DecodeError::QuantityOutOfRange if the quantity is not in 1..=1968.
Returns DecodeError::ByteCountMismatch if the declared byte count does not
match the remaining data length.
Trait Implementations§
Source§impl<'buf> Clone for WriteMultipleCoilsRequest<'buf>
impl<'buf> Clone for WriteMultipleCoilsRequest<'buf>
Source§fn clone(&self) -> WriteMultipleCoilsRequest<'buf>
fn clone(&self) -> WriteMultipleCoilsRequest<'buf>
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<'buf> Copy for WriteMultipleCoilsRequest<'buf>
Source§impl<'buf> Debug for WriteMultipleCoilsRequest<'buf>
impl<'buf> Debug for WriteMultipleCoilsRequest<'buf>
Source§impl Encode for WriteMultipleCoilsRequest<'_>
impl Encode for WriteMultipleCoilsRequest<'_>
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<'buf> Eq for WriteMultipleCoilsRequest<'buf>
Source§impl<'buf> PartialEq for WriteMultipleCoilsRequest<'buf>
impl<'buf> PartialEq for WriteMultipleCoilsRequest<'buf>
Source§fn eq(&self, other: &WriteMultipleCoilsRequest<'buf>) -> bool
fn eq(&self, other: &WriteMultipleCoilsRequest<'buf>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'buf> StructuralPartialEq for WriteMultipleCoilsRequest<'buf>
Auto Trait Implementations§
impl<'buf> Freeze for WriteMultipleCoilsRequest<'buf>
impl<'buf> RefUnwindSafe for WriteMultipleCoilsRequest<'buf>
impl<'buf> Send for WriteMultipleCoilsRequest<'buf>
impl<'buf> Sync for WriteMultipleCoilsRequest<'buf>
impl<'buf> Unpin for WriteMultipleCoilsRequest<'buf>
impl<'buf> UnsafeUnpin for WriteMultipleCoilsRequest<'buf>
impl<'buf> UnwindSafe for WriteMultipleCoilsRequest<'buf>
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