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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn handles_subscription(&self, operation_name: &str) -> bool
fn handles_subscription(&self, operation_name: &str) -> bool
Check if this handler handles the given subscription