Function process_webhook_event

Source
pub fn process_webhook_event<H: WebhookEventHandler>(
    handler: &mut H,
    event_type: &str,
    payload: Value,
) -> Result<(), WebhookError<H::Error>>
Expand description

Process a webhook event using the provided handler

This function parses the payload based on the event type and calls the appropriate handler method.

§Arguments

  • handler - Mutable reference to an event handler
  • event_type - The type of event (e.g., “topic_created”)
  • payload - The JSON payload from the webhook

§Returns

  • Ok(()) if the event was processed successfully
  • Err(WebhookError) if parsing or handling failed