pub trait OutboundWebhookHandler:
Send
+ Sync
+ 'static {
// Required methods
fn get_subscriptions(
&self,
topic: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookSubscription>>> + Send>>;
fn log_delivery(
&self,
log: WebhookDeliveryLog,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>;
fn replace_delivery_log(
&self,
log: WebhookDeliveryLog,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>;
fn get_subscription(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookSubscription>>> + Send>>;
fn get_delivery_log(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookDeliveryLog>>> + Send>>;
// Provided methods
fn get_dlq_logs(
&self,
) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookDeliveryLog>>> + Send>> { ... }
fn reset_subscription_failures(
&self,
_id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>> { ... }
fn reactivate_failed_subscription(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>> { ... }
}Expand description
Pluggable handler interface for outbound webhook subscriptions and delivery logs.
Required Methods§
Sourcefn get_subscriptions(
&self,
topic: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookSubscription>>> + Send>>
fn get_subscriptions( &self, topic: &str, ) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookSubscription>>> + Send>>
Retrieve active subscriptions registered for a specific event topic.
Sourcefn log_delivery(
&self,
log: WebhookDeliveryLog,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
fn log_delivery( &self, log: WebhookDeliveryLog, ) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
Log a webhook delivery attempt and handle failure counters/statuses.
Sourcefn replace_delivery_log(
&self,
log: WebhookDeliveryLog,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
fn replace_delivery_log( &self, log: WebhookDeliveryLog, ) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
Replace a stored delivery log without treating it as a new delivery outcome.
Implementations must perform a plain record replacement. This must not update subscription failure counters or auto-failure state.
Sourcefn get_subscription(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookSubscription>>> + Send>>
fn get_subscription( &self, id: &str, ) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookSubscription>>> + Send>>
Retrieve a specific webhook subscription by ID (regardless of status/active state).
Sourcefn get_delivery_log(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookDeliveryLog>>> + Send>>
fn get_delivery_log( &self, id: &str, ) -> Pin<Box<dyn Future<Output = AutumnResult<Option<WebhookDeliveryLog>>> + Send>>
Get a specific delivery log by ID.
Provided Methods§
Sourcefn get_dlq_logs(
&self,
) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookDeliveryLog>>> + Send>>
fn get_dlq_logs( &self, ) -> Pin<Box<dyn Future<Output = AutumnResult<Vec<WebhookDeliveryLog>>> + Send>>
Optional: List only permanently failed delivery attempts archived in the Dead Letter Queue.
Sourcefn reset_subscription_failures(
&self,
_id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
fn reset_subscription_failures( &self, _id: &str, ) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
Optional: Reset consecutive failures for a subscription.
Sourcefn reactivate_failed_subscription(
&self,
id: &str,
) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
fn reactivate_failed_subscription( &self, id: &str, ) -> Pin<Box<dyn Future<Output = AutumnResult<()>> + Send>>
Optional: Reactivate a subscription that was auto-marked as failed.
Manual DLQ replays need to bypass the automatic failure guard without re-enabling subscriptions that an operator explicitly disabled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".