Skip to main content

ClientResponse

Enum ClientResponse 

Source
pub enum ClientResponse {
Show 16 variants Coils(Coils), HoldingRegisters(HoldingRegisters), InputRegisters(InputRegisters), SingleRegisterWrite { address: u16, value: u16, }, MaskWriteRegister, DiscreteInputs(DiscreteInputs), FifoQueue(FifoQueue), FileRecordRead(Vec<SubRequestParams, MAX_SUB_REQUESTS_PER_PDU>), FileRecordWrite, DeviceIdentification(DeviceIdentificationResponse), EncapsulatedInterfaceTransport { mei_type: EncapsulatedInterfaceType, data: Vec<u8, MAX_PDU_DATA_LEN>, }, ExceptionStatus(u8), DiagnosticsData { sub_function: DiagnosticSubFunction, data: Vec<u16, MAX_PDU_DATA_LEN>, }, CommEventCounter { status: u16, event_count: u16, }, CommEventLog { status: u16, event_count: u16, message_count: u16, events: Vec<u8, MAX_PDU_DATA_LEN>, }, ReportServerId(Vec<u8, MAX_PDU_DATA_LEN>),
}
Expand description

Typed response payload returned to the async caller via a oneshot channel.

The task encodes the response variant that matches the outgoing request type. AsyncClientCore pattern-matches the variant to extract the concrete return type expected by each public method.

Variants§

§

Coils(Coils)

Read Coils (FC 01), Write Single Coil (FC 05), Write Multiple Coils (FC 0F).

§

HoldingRegisters(HoldingRegisters)

Read Holding Registers (FC 03), Read Input Registers (FC 04), Write Multiple Registers (FC 10), Read/Write Multiple Registers (FC 17).

§

InputRegisters(InputRegisters)

Read Input Registers (FC 04).

§

SingleRegisterWrite

Write Single Register (FC 06) echo-back confirmation.

Fields

§address: u16

Echoed register address.

§value: u16

Echoed written value.

§

MaskWriteRegister

Mask Write Register (FC 16) acknowledgement.

§

DiscreteInputs(DiscreteInputs)

Read Discrete Inputs (FC 02).

§

FifoQueue(FifoQueue)

Read FIFO Queue (FC 18).

§

FileRecordRead(Vec<SubRequestParams, MAX_SUB_REQUESTS_PER_PDU>)

Read File Record (FC 14) — parsed sub-request results.

§

FileRecordWrite

Write File Record (FC 15) acknowledgement.

§

DeviceIdentification(DeviceIdentificationResponse)

Read Device Identification (FC 43 / MEI 0E).

§

EncapsulatedInterfaceTransport

Encapsulated Interface Transport (FC 43 / non-0E MEI type).

Fields

§mei_type: EncapsulatedInterfaceType

MEI type code from the response.

§data: Vec<u8, MAX_PDU_DATA_LEN>

Raw response bytes.

§

ExceptionStatus(u8)

Read Exception Status (FC 07).

§

DiagnosticsData

Diagnostics (FC 08) echo-back.

Fields

§sub_function: DiagnosticSubFunction

Echoed sub-function code.

§data: Vec<u16, MAX_PDU_DATA_LEN>

Echoed data words.

§

CommEventCounter

Get Comm Event Counter (FC 0B).

Fields

§status: u16

Device communication status word.

§event_count: u16

Number of successfully completed events since last restart.

§

CommEventLog

Get Comm Event Log (FC 0C).

Fields

§status: u16

Device communication status word.

§event_count: u16

Total events recorded.

§message_count: u16

Total messages processed.

§events: Vec<u8, MAX_PDU_DATA_LEN>

Raw event bytes (oldest first).

§

ReportServerId(Vec<u8, MAX_PDU_DATA_LEN>)

Report Server ID (FC 11).

Trait Implementations§

Source§

impl Debug for ClientResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.