Enum tokio_modbus::prelude::Request[][src]

pub enum Request {
    ReadCoils(u16u16),
    ReadDiscreteInputs(u16u16),
    WriteSingleCoil(u16bool),
    WriteMultipleCoils(u16Vec<bool>),
    ReadInputRegisters(u16u16),
    ReadHoldingRegisters(u16u16),
    WriteSingleRegister(u16u16),
    WriteMultipleRegisters(u16Vec<u16>),
    ReadWriteMultipleRegisters(u16u16u16Vec<u16>),
    Custom(u8Vec<u8>),
    Disconnect,
}
Expand description

A request represents a message from the client (master) to the server (slave).

Variants

ReadCoils(u16u16)

Tuple Fields

0: u16
1: u16

A request to read multiple coils. The first parameter is the address of the first coil to read. The second parameter is the number of coils to read.

ReadDiscreteInputs(u16u16)

Tuple Fields

0: u16
1: u16

A request to read multiple discrete inputs The first parameter is the address of the first discrete input to read. The second parameter is the number of discrete inputs to read.

WriteSingleCoil(u16bool)

Tuple Fields

0: u16
1: bool

A request to write a single coil. The first parameter is the address of the coil. The second parameter is the value to write to the coil.

WriteMultipleCoils(u16Vec<bool>)

Tuple Fields

0: u16
1: Vec<bool>

A request to write multiple coils. The first parameter is the address of the first coil to write. The second parameter is the vector of values to write to the coils.

ReadInputRegisters(u16u16)

Tuple Fields

0: u16
1: u16

A request to read multiple input registers. The first parameter is the address of the first input register to read. The second parameter is the number of input registers to read.

ReadHoldingRegisters(u16u16)

Tuple Fields

0: u16
1: u16

A request to read multiple holding registers. The first parameter is the address of the first holding register to read. The second parameter is the number of holding registers to read.

WriteSingleRegister(u16u16)

Tuple Fields

0: u16
1: u16

A request to write a single register. The first parameter is the address of the register to read. The second parameter is the value to write to the register.

WriteMultipleRegisters(u16Vec<u16>)

Tuple Fields

0: u16
1: Vec<u16>

A request to write to multiple registers. The first parameter is the address of the first register to write. The second parameter is the vector of values to write to the registers.

ReadWriteMultipleRegisters(u16u16u16Vec<u16>)

Tuple Fields

0: u16
1: u16
2: u16
3: Vec<u16>

A request to simultaneously read multiple registers and write multiple registers. The first parameter is the address of the first register to read. The second parameter is the number of registers to read. The third parameter is the address of the first register to write. The fourth parameter is the vector of values to write to the registers.

Custom(u8Vec<u8>)

Tuple Fields

0: u8
1: Vec<u8>

A raw Modbus request. The first parameter is the Modbus function code. The second parameter is the raw bytes of the request.

Disconnect

A poison pill for stopping the client service and to release the underlying transport, e.g. for disconnecting from an exclusively used serial port.

This is an ugly workaround, because tokio-proto does not provide other means to gracefully shut down the ClientService. Otherwise the bound transport is never freed as long as the executor is active, even when dropping the Modbus client context.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.