pub trait IotClient {
// Required methods
fn connect(&mut self) -> impl Future<Output = IotResult<()>> + Send;
fn disconnect(&mut self) -> impl Future<Output = IotResult<()>> + Send;
fn read_property(
&mut self,
path: &PropertyPath,
) -> impl Future<Output = IotResult<PropertySample>> + Send;
fn write_property(
&mut self,
path: &PropertyPath,
value: Value,
) -> impl Future<Output = IotResult<()>> + Send;
}Expand description
The unified interface every protocol client implements.
Methods are intentionally narrow: read one path, write one path,
observe one path. Protocols that natively support batch reads (Modbus,
OPC UA ReadRequest) expose batching via their native API; the
gateway only ever needs one-by-one access.
Required Methods§
Sourcefn connect(&mut self) -> impl Future<Output = IotResult<()>> + Send
fn connect(&mut self) -> impl Future<Output = IotResult<()>> + Send
Connect — must be called before any read / write / observe call.
Sourcefn read_property(
&mut self,
path: &PropertyPath,
) -> impl Future<Output = IotResult<PropertySample>> + Send
fn read_property( &mut self, path: &PropertyPath, ) -> impl Future<Output = IotResult<PropertySample>> + Send
Read the current value of a bound property.
Sourcefn write_property(
&mut self,
path: &PropertyPath,
value: Value,
) -> impl Future<Output = IotResult<()>> + Send
fn write_property( &mut self, path: &PropertyPath, value: Value, ) -> impl Future<Output = IotResult<()>> + Send
Write a value to a bound property.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".