WebhookSender

Trait WebhookSender 

Source
pub trait WebhookSender: Send + Sync {
    // Required method
    fn send(
        &self,
        changes: &[IpChange],
    ) -> impl Future<Output = Result<(), WebhookError>> + Send;
}
Expand description

Trait for sending IP change notifications to external services.

This abstraction allows for different notification mechanisms (HTTP webhooks, message queues, etc.) and enables testing with mocks.

§Implementation Notes

Implementations should handle retries internally if appropriate, returning WebhookError::MaxRetriesExceeded when all attempts fail.

Required Methods§

Source

fn send( &self, changes: &[IpChange], ) -> impl Future<Output = Result<(), WebhookError>> + Send

Sends a notification about IP address changes.

§Arguments
  • changes - The IP address changes to report
§Errors

Returns WebhookError if the notification fails after all retries.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§