Struct WebhookIdempotency
pub struct WebhookIdempotency { /* private fields */ }Expand description
Live callbacks into the gateway’s canonical idempotency store.
The plugin worker invokes this only after guest authentication and live host sender authorization. Ownership tokens make rollback conditional, and an in-flight duplicate receives a waiter rather than a premature success.
Implementations§
Source§impl WebhookIdempotency
impl WebhookIdempotency
Sourcepub fn new(
begin: impl Fn(&str) -> WebhookReservation + Send + Sync + 'static,
commit: impl Fn(&WebhookReservationToken) -> bool + Send + Sync + 'static,
rollback: impl Fn(&WebhookReservationToken) -> bool + Send + Sync + 'static,
) -> Self
pub fn new( begin: impl Fn(&str) -> WebhookReservation + Send + Sync + 'static, commit: impl Fn(&WebhookReservationToken) -> bool + Send + Sync + 'static, rollback: impl Fn(&WebhookReservationToken) -> bool + Send + Sync + 'static, ) -> Self
Build a bridge to a host-owned reservation store.
Sourcepub fn begin(&self, message_id: &str) -> WebhookReservation
pub fn begin(&self, message_id: &str) -> WebhookReservation
Begin or observe delivery for one stable message ID.
Sourcepub fn commit(&self, token: &WebhookReservationToken) -> bool
pub fn commit(&self, token: &WebhookReservationToken) -> bool
Commit only if token still owns the exact reservation generation.
Sourcepub fn rollback(&self, token: &WebhookReservationToken) -> bool
pub fn rollback(&self, token: &WebhookReservationToken) -> bool
Roll back only if token still owns the exact reservation generation.
Trait Implementations§
Source§impl Clone for WebhookIdempotency
impl Clone for WebhookIdempotency
Source§fn clone(&self) -> WebhookIdempotency
fn clone(&self) -> WebhookIdempotency
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebhookIdempotency
impl !UnwindSafe for WebhookIdempotency
impl Freeze for WebhookIdempotency
impl Send for WebhookIdempotency
impl Sync for WebhookIdempotency
impl Unpin for WebhookIdempotency
impl UnsafeUnpin for WebhookIdempotency
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