Skip to main content

WebhookHandler

Trait WebhookHandler 

Source
pub trait WebhookHandler: Send + Sync {
    // Required methods
    fn path(&self) -> String;
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: WebhookRequest,
    ) -> Pin<Box<dyn Future<Output = WebhookResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Receives webhook requests for one channel.

Implementations authenticate the request, hand events to the runtime and return quickly: platforms time out slow webhooks, and agent turns are slow.

Required Methods§

Source

fn path(&self) -> String

Mount path, without the bot prefix (for example zalo/shop).

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: WebhookRequest, ) -> Pin<Box<dyn Future<Output = WebhookResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles one request.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§