Skip to main content

Function

Trait Function 

Source
pub trait Function: Code {
    type Args: Encode;
    type Output: Decode + IntoValue;
}
Expand description

Trait that ties function code, arguments and output together.

Users are free to implement their own functions – be that custom Modbus functions or alternate standard function implementations. In the latter case, consider making a pull request.

Required Associated Types§

Source

type Args: Encode

Function arguments type.

It must be encodable to get sent in the request.

Source

type Output: Decode + IntoValue

Function output type.

It must be decodable from the response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A, V> Function for ReadCoils<A, V>
where Args<A, V, Bits>: Encode, Output<V>: Decode,

Source§

type Args = Args<A, V, Bits>

Source§

type Output = Output<V>

Source§

impl<A, V> Function for ReadDiscreteInputs<A, V>
where Args<A, V, Bits>: Encode, Output<V>: Decode,

Source§

type Args = Args<A, V, Bits>

Source§

type Output = Output<V>

Source§

impl<A, V> Function for ReadHoldingRegisters<A, V>
where Args<A, V, Words>: Encode, Output<V>: Decode,

Source§

type Args = Args<A, V, Words>

Source§

type Output = Output<V>

Source§

impl<A, V> Function for ReadInputRegisters<A, V>
where Args<A, V, Words>: Encode, Output<V>: Decode,

Source§

type Args = Args<A, V, Words>

Source§

type Output = Output<V>

Source§

impl<A, V> Function for WriteMultipleRegisters<A, V>
where Args<A, V, Words>: Encode,

Source§

type Args = Args<A, V, Words>

Source§

type Output = Output