Reader

Trait Reader 

Source
pub trait Reader: Client {
    // Required methods
    fn read_coils<'life0, 'async_trait>(
        &'life0 mut self,
        addr: Address,
        cnt: Quantity,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_discrete_inputs<'life0, 'async_trait>(
        &'life0 mut self,
        addr: Address,
        cnt: Quantity,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_holding_registers<'life0, 'async_trait>(
        &'life0 mut self,
        addr: Address,
        cnt: Quantity,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_input_registers<'life0, 'async_trait>(
        &'life0 mut self,
        addr: Address,
        cnt: Quantity,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_write_multiple_registers<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        read_addr: Address,
        read_count: Quantity,
        write_addr: Address,
        write_data: &'life1 [u16],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_device_identification<'life0, 'async_trait>(
        &'life0 mut self,
        read_code: ReadCode,
        object_id: ObjectId,
    ) -> Pin<Box<dyn Future<Output = Result<ReadDeviceIdentificationResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Asynchronous Modbus reader

Required Methods§

Source

fn read_coils<'life0, 'async_trait>( &'life0 mut self, addr: Address, cnt: Quantity, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read multiple coils (0x01)

Source

fn read_discrete_inputs<'life0, 'async_trait>( &'life0 mut self, addr: Address, cnt: Quantity, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read multiple discrete inputs (0x02)

Source

fn read_holding_registers<'life0, 'async_trait>( &'life0 mut self, addr: Address, cnt: Quantity, ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read multiple holding registers (0x03)

Source

fn read_input_registers<'life0, 'async_trait>( &'life0 mut self, addr: Address, cnt: Quantity, ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read multiple input registers (0x04)

Source

fn read_write_multiple_registers<'life0, 'life1, 'async_trait>( &'life0 mut self, read_addr: Address, read_count: Quantity, write_addr: Address, write_data: &'life1 [u16], ) -> Pin<Box<dyn Future<Output = Result<Vec<u16>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read and write multiple holding registers (0x17)

The write operation is performed before the read unlike the name of the operation might suggest!

Source

fn read_device_identification<'life0, 'async_trait>( &'life0 mut self, read_code: ReadCode, object_id: ObjectId, ) -> Pin<Box<dyn Future<Output = Result<ReadDeviceIdentificationResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read device identification (0x2B / 0x0E)

Implementors§