SubscriptionHandler

Trait SubscriptionHandler 

Source
pub trait SubscriptionHandler: Send + Sync {
    // Required methods
    fn on_subscribe<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        variables: &'life2 HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn initial_data<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        variables: &'life2 HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn handles_subscription(&self, operation_name: &str) -> bool;
}
Expand description

Subscription handler trait

Required Methods§

Source

fn on_subscribe<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 str, variables: &'life2 HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle a new subscription

Source

fn initial_data<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 str, variables: &'life2 HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Generate initial data for a subscription

Source

fn handles_subscription(&self, operation_name: &str) -> bool

Check if this handler handles the given subscription

Implementors§