Skip to main content

DeviceControlHook

Trait DeviceControlHook 

Source
pub trait DeviceControlHook: Send + Sync {
    // Required methods
    fn display_glyph<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        device_type: &'life1 str,
        device_id: &'life2 str,
        pattern: &'life3 str,
        brightness: Option<f32>,
        timeout_ms: Option<u32>,
        transition: Option<&'life4 str>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn connect_device<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        device_type: &'life1 str,
        device_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn disconnect_device<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        device_type: &'life1 str,
        device_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait the WS client uses to dispatch device-control frames. The concrete impl lives in the binary that owns the device handles (edge-agent for Nuimo today; future targets register their own).

Required Methods§

Source

fn display_glyph<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, device_type: &'life1 str, device_id: &'life2 str, pattern: &'life3 str, brightness: Option<f32>, timeout_ms: Option<u32>, transition: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Render pattern on the device’s display. pattern is a 9-line ASCII grid (* = on). brightness is on the closed interval 0.0..=1.0; None = implementation default. timeout_ms is the auto-clear timeout; None = implementation default. transition is "immediate" or "cross_fade"; None = implementation default.

Source

fn connect_device<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, device_type: &'life1 str, device_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Re-attempt a connection to the device. Implementations should clear any “paused” flag that suppresses auto-reconnect.

Source

fn disconnect_device<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, device_type: &'life1 str, device_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Drop the active connection and set “paused” so the auto-reconnect loop does not immediately re-establish the link.

Implementors§