Sigil documentation
ReferenceRust referencesigil-labor-api

sigil-labor-api · idempotency

Source declarations, signatures and documentation for idempotency.

Source: sigil/node/../labor-api/src/idempotency.rs. SHA-256: b8196b939a77fd70da3d1f049d6e4b8a1b75c666071c87f72841f33226d2ef43.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

idempotency::IdempotencyCache

The shared idempotency cache. Cheap to clone — wraps an Arc<Mutex<…>>.

#[derive(Clone, Default)]
pub struct IdempotencyCache {

}

Source line: 83.

idempotency::IdempotencyCache::new

pub fn new() -> Self;

Source line: 89.

idempotency::IdempotencyCache::with_ttl

pub fn with_ttl(mut self, ttl: Duration) -> Self;

Source line: 96.

idempotency::idempotency_middleware

Tower middleware: deduplicate POST requests by Idempotency-Key.

Read methods (GET, HEAD) bypass the cache.

pub async fn idempotency_middleware(cache: IdempotencyCache, req: Request, next: Next) -> Response;

Source line: 138.

On this page