Skip to main content

WebhookHandler

Trait WebhookHandler 

Source
pub trait WebhookHandler:
    Send
    + Sync
    + 'static {
    type Error: Display + Send + Sync + 'static;

    // Required method
    fn handle(
        &self,
        event: WebhookEvent,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Processes authenticated, parsed webhook events that passed their filters.

Required Associated Types§

Source

type Error: Display + Send + Sync + 'static

The failure returned when an accepted event cannot be processed.

Required Methods§

Source

fn handle( &self, event: WebhookEvent, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Processes one accepted event.

§Errors

Returning an error produces a 500 Internal Server Error response so pretix can retry the delivery.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<F, Fut, E> WebhookHandler for F
where F: Fn(WebhookEvent) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<(), E>> + Send, E: Display + Send + Sync + 'static,

Source§

type Error = E