pub struct IdempotencyMiddleware<S: IdempotencyStore> { /* private fields */ }Expand description
Idempotency middleware that wraps event processing
Implementations§
Source§impl<S: IdempotencyStore> IdempotencyMiddleware<S>
impl<S: IdempotencyStore> IdempotencyMiddleware<S>
Sourcepub async fn should_process(&self, event_id: &str) -> StripeWebhookResult<bool>
pub async fn should_process(&self, event_id: &str) -> StripeWebhookResult<bool>
Check if event should be processed
§Returns
Ok(true)if event should be processed (new event)Ok(false)if event was already processed (return 202)Errfor already-processed events that need special handling
Sourcepub async fn complete(&self, event_id: &str) -> StripeWebhookResult<()>
pub async fn complete(&self, event_id: &str) -> StripeWebhookResult<()>
Mark event processing as complete
Auto Trait Implementations§
impl<S> Freeze for IdempotencyMiddleware<S>
impl<S> RefUnwindSafe for IdempotencyMiddleware<S>where
S: RefUnwindSafe,
impl<S> Send for IdempotencyMiddleware<S>
impl<S> Sync for IdempotencyMiddleware<S>
impl<S> Unpin for IdempotencyMiddleware<S>
impl<S> UnwindSafe for IdempotencyMiddleware<S>where
S: RefUnwindSafe,
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 more