Skip to main content

DevicePort

Trait DevicePort 

Source
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§

Source

fn info(&self) -> DeviceInfo

Returns the current device metadata snapshot.

Source

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.

Source

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.

Source

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,

Reads a point value.

Source

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,

Writes a point value.

Provided Methods§

Source

fn id(&self) -> String

Returns the stable device identifier.

Source

fn state(&self) -> DeviceState

Returns the current device state.

Source

fn point_definitions(&self) -> Vec<DataPointDef>

Returns the point definitions exposed by the device, if available.

Implementors§