Skip to main content

Bridge

Trait Bridge 

Source
pub trait Bridge: Send + Sync {
    // Required methods
    fn get_device_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = BridgeResult<Option<DeviceInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn device_info_updated<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = BridgeResult<DeviceInfoStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_device_info<'life0, 'async_trait>(
        &'life0 self,
        info: Option<DeviceInfo>,
    ) -> Pin<Box<dyn Future<Output = BridgeResult<Option<DeviceInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn data_requested<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = DataRequestedStream> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_data<'life0, 'async_trait>(
        &'life0 self,
        data: StateChange,
    ) -> Pin<Box<dyn Future<Output = BridgeResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commands<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CommandStream> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The connection between an Arora runtime and a remote (e.g. Semio Studio).

Modelled on studio-bridge’s device-client. Interior-mutable (&self) so the runtime can share it across the tasks of its run loop.

Required Methods§

Source

fn get_device_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BridgeResult<Option<DeviceInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The device’s current info, if registered.

Source

fn device_info_updated<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BridgeResult<DeviceInfoStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A stream of device-info updates from the remote (Ok(None) = unregistered).

Source

fn update_device_info<'life0, 'async_trait>( &'life0 self, info: Option<DeviceInfo>, ) -> Pin<Box<dyn Future<Output = BridgeResult<Option<DeviceInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Push updated device info to the remote; returns the merged result.

Source

fn data_requested<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = DataRequestedStream> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A stream that toggles as a client claims/releases interest in the data.

Source

fn send_data<'life0, 'async_trait>( &'life0 self, data: StateChange, ) -> Pin<Box<dyn Future<Output = BridgeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Push a state change out to the remote.

Source

fn commands<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CommandStream> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A stream of commands the remote issues to the device.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§