Skip to main content

ServiceAdapter

Trait ServiceAdapter 

Source
pub trait ServiceAdapter: Send + Sync {
    // Required methods
    fn service_type(&self) -> &'static str;
    fn send_intent<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        target: &'life1 str,
        intent: &'life2 Intent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn subscribe_state(&self) -> Receiver<StateUpdate>;
}

Required Methods§

Source

fn service_type(&self) -> &'static str

Stable identifier used to match against Mapping.service_type.

Source

fn send_intent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target: &'life1 str, intent: &'life2 Intent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send an intent to a specific target (zone_id, group_id, …).

Source

fn subscribe_state(&self) -> Receiver<StateUpdate>

Subscribe to state updates from this adapter.

Implementors§