Skip to main content

Crate use_idempotency

Crate use_idempotency 

Source
Expand description

§use-idempotency

Idempotency primitives for RustUse.

Models idempotency keys, scopes, replay status, request fingerprint labels, and conflict status metadata.

§Example

use use_idempotency::{ReplayStatus, IdempotencyKey};

let value = IdempotencyKey::new("checkout:abc123").expect("valid API primitive");

assert_eq!(value.as_str(), "checkout:abc123");
assert_eq!(ReplayStatus::Original.to_string(), "original");

§Scope

  • Small validated types for API metadata.
  • Stable display labels and conservative parsing helpers.
  • Dependency-light primitives that can be reused by other RustUse crates.

§Non-goals

  • No storage backend.
  • No request hashing.
  • No distributed lock implementation.

§License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license

Structs§

IdempotencyKey
IdempotencyScope
PrimitiveMetadata
Lightweight metadata tying this crate’s primary text and label together.
RequestFingerprintLabel

Enums§

ApiPrimitiveError
Error returned when API primitive text or labels are invalid.
ConflictStatus
Idempotency conflict status labels.
ReplayStatus
Idempotency replay status labels.