pub trait DevicePort: Send + Sync {
// Required methods
fn info(&self) -> DeviceInfo;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
point_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = CoreResult<DataPoint>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
point_id: &'life1 str,
value: Value,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn id(&self) -> String { ... }
fn state(&self) -> DeviceState { ... }
fn point_definitions(&self) -> Vec<DataPointDef> { ... }
}Expand description
Shared protocol-agnostic device surface for controllers.
Required Methods§
Sourcefn info(&self) -> DeviceInfo
fn info(&self) -> DeviceInfo
Returns the current device metadata snapshot.
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts the device port if supported.
Sourcefn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stops the device port if supported.
Provided Methods§
Sourcefn state(&self) -> DeviceState
fn state(&self) -> DeviceState
Returns the current device state.
Sourcefn point_definitions(&self) -> Vec<DataPointDef>
fn point_definitions(&self) -> Vec<DataPointDef>
Returns the point definitions exposed by the device, if available.