pub struct IdempotencyCtx {
pub header: String,
pub stored_body_sha256: String,
}Expand description
Idempotency context for a case where an Idempotency-Key is in
play.
Real APIs (Stripe, many fintech providers) store the SHA-256 of the
body that arrived under a given key. A retry with the same key but
a different body is rejected. The idempotency_collision rule
recomputes the digest of the current request body and compares.
Fields§
§header: StringName of the idempotency-key header (e.g., "idempotency-key").
stored_body_sha256: StringHex-encoded SHA-256 of the body the server originally stored under this idempotency key. Must be exactly 64 hex characters.
Trait Implementations§
Source§impl Clone for IdempotencyCtx
impl Clone for IdempotencyCtx
Source§fn clone(&self) -> IdempotencyCtx
fn clone(&self) -> IdempotencyCtx
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdempotencyCtx
impl Debug for IdempotencyCtx
Source§impl<'de> Deserialize<'de> for IdempotencyCtx
impl<'de> Deserialize<'de> for IdempotencyCtx
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IdempotencyCtx
impl RefUnwindSafe for IdempotencyCtx
impl Send for IdempotencyCtx
impl Sync for IdempotencyCtx
impl Unpin for IdempotencyCtx
impl UnsafeUnpin for IdempotencyCtx
impl UnwindSafe for IdempotencyCtx
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