pub struct WebhookSender { /* private fields */ }Expand description
Webhook sender for dispatching failure notifications.
Implementations§
Source§impl WebhookSender
impl WebhookSender
Sourcepub fn new(configs: Vec<WebhookConfig>) -> Self
pub fn new(configs: Vec<WebhookConfig>) -> Self
Create a new webhook sender.
Sourcepub async fn send(&self, payload: WebhookPayload)
pub async fn send(&self, payload: WebhookPayload)
Send webhook notification for an event.
Sends to all configured webhooks that subscribe to this event type. Failures are logged at error level but don’t propagate — webhooks are best-effort but must not be silently swallowed.
Sourcepub async fn notify_upload_failed(
&self,
database: &str,
error: &str,
attempts: u32,
)
pub async fn notify_upload_failed( &self, database: &str, error: &str, attempts: u32, )
Send upload_failed notification.
Sourcepub async fn notify_auth_failure(&self, database: &str, error: &str)
pub async fn notify_auth_failure(&self, database: &str, error: &str)
Send auth_failure notification.
Sourcepub async fn notify_corruption(&self, database: &str, error: &str)
pub async fn notify_corruption(&self, database: &str, error: &str)
Send corruption_detected notification.
Sourcepub async fn notify_circuit_breaker_open(
&self,
database: &str,
consecutive_failures: u32,
)
pub async fn notify_circuit_breaker_open( &self, database: &str, consecutive_failures: u32, )
Send circuit_breaker_open notification.
Auto Trait Implementations§
impl Freeze for WebhookSender
impl !RefUnwindSafe for WebhookSender
impl Send for WebhookSender
impl Sync for WebhookSender
impl Unpin for WebhookSender
impl UnsafeUnpin for WebhookSender
impl !UnwindSafe for WebhookSender
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.