Skip to main content

CallbackHandler

Trait CallbackHandler 

Source
pub trait CallbackHandler: Send + Sync {
    // Required methods
    fn process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: Arc<DingTalkStream>,
        message: &'life1 CallbackMessage,
        cb_webhook_msg_sender: Option<Sender<WebhookMessage>>,
    ) -> Pin<Box<dyn Future<Output = Result<Resp, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn topic(&self) -> &MessageTopic;

    // Provided method
    fn pre_start(&self) { ... }
}
Expand description

Callback handler trait for handling callback messages

Required Methods§

Source

fn process<'life0, 'life1, 'async_trait>( &'life0 self, client: Arc<DingTalkStream>, message: &'life1 CallbackMessage, cb_webhook_msg_sender: Option<Sender<WebhookMessage>>, ) -> Pin<Box<dyn Future<Output = Result<Resp, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process a callback message

Source

fn topic(&self) -> &MessageTopic

Get the topic this handler handles

Provided Methods§

Source

fn pre_start(&self)

Pre-start hook

Implementors§