pub struct WebhookDelivery { /* private fields */ }Expand description
The HTTP webhook delivery adapter.
§Why a reqwest::Client and not a tokio::net::TcpStream
A consumer who needs a custom HTTP client (a mock for tests, a custom TLS configuration, a different redirect policy) passes their own. The default is a 10-second connect / 10-second read timeout — long enough for a slow webhook target, short enough that a hung target does not tie up a worker.
Implementations§
Source§impl WebhookDelivery
impl WebhookDelivery
Sourcepub fn new(filter: Arc<dyn UrlFilter>) -> Self
pub fn new(filter: Arc<dyn UrlFilter>) -> Self
Builds a new webhook delivery adapter with the default timeouts (10 seconds connect, 10 seconds read) and a redirect limit of 5. The redirect limit is a guard against infinite redirect loops, not a quality-of-service promise.
Sourcepub fn with_client(client: Client, filter: Arc<dyn UrlFilter>) -> Self
pub fn with_client(client: Client, filter: Arc<dyn UrlFilter>) -> Self
Builds a new webhook delivery
adapter with a caller-supplied
reqwest::Client. The adapter
does not modify the client; the
caller owns TLS, redirect, and
timeout configuration.
Trait Implementations§
Source§impl Debug for WebhookDelivery
impl Debug for WebhookDelivery
Source§impl PushNotificationDelivery for WebhookDelivery
impl PushNotificationDelivery for WebhookDelivery
Source§async fn deliver(
&self,
config: &NotificationConfig,
body: &[u8],
) -> Result<(), NotificationConfigError>
async fn deliver( &self, config: &NotificationConfig, body: &[u8], ) -> Result<(), NotificationConfigError>
Delivers one notification. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for WebhookDelivery
impl !UnwindSafe for WebhookDelivery
impl Freeze for WebhookDelivery
impl Send for WebhookDelivery
impl Sync for WebhookDelivery
impl Unpin for WebhookDelivery
impl UnsafeUnpin for WebhookDelivery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more