pub struct StripeWebhookState<H: SubscriptionHandler, S: IdempotencyStore = InMemoryIdempotencyStore> {
pub verifier: SignatureVerifier,
pub idempotency: IdempotencyMiddleware<S>,
pub processor: EventProcessor<H, S>,
pub config: StripeWebhookConfig,
pub log_payloads: bool,
}Expand description
Shared state for the webhook handler
Fields§
§verifier: SignatureVerifierSignature verifier
idempotency: IdempotencyMiddleware<S>Idempotency middleware
processor: EventProcessor<H, S>Event processor
config: StripeWebhookConfigConfiguration
log_payloads: boolWhether to log payloads (DISABLE in production)
Implementations§
Source§impl<H: SubscriptionHandler> StripeWebhookState<H, InMemoryIdempotencyStore>
impl<H: SubscriptionHandler> StripeWebhookState<H, InMemoryIdempotencyStore>
Sourcepub fn new(
config: StripeWebhookConfig,
handler: Arc<H>,
) -> (Self, ProcessorHandle<H, InMemoryIdempotencyStore>)
pub fn new( config: StripeWebhookConfig, handler: Arc<H>, ) -> (Self, ProcessorHandle<H, InMemoryIdempotencyStore>)
Create new state with in-memory idempotency store
Source§impl<H: SubscriptionHandler, S: IdempotencyStore> StripeWebhookState<H, S>
impl<H: SubscriptionHandler, S: IdempotencyStore> StripeWebhookState<H, S>
Sourcepub fn with_store(
config: StripeWebhookConfig,
handler: Arc<H>,
store: Arc<S>,
) -> (Self, ProcessorHandle<H, S>)
pub fn with_store( config: StripeWebhookConfig, handler: Arc<H>, store: Arc<S>, ) -> (Self, ProcessorHandle<H, S>)
Create new state with custom idempotency store
Auto Trait Implementations§
impl<H, S> Freeze for StripeWebhookState<H, S>
impl<H, S> RefUnwindSafe for StripeWebhookState<H, S>where
S: RefUnwindSafe,
H: RefUnwindSafe,
impl<H, S> Send for StripeWebhookState<H, S>
impl<H, S> Sync for StripeWebhookState<H, S>
impl<H, S> Unpin for StripeWebhookState<H, S>
impl<H, S> UnwindSafe for StripeWebhookState<H, S>where
S: RefUnwindSafe,
H: 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