Skip to main content

Crate pacta_memory

Crate pacta_memory 

Source
Expand description

An in-memory Registry backend with real lease and lapse semantics.

This is a reference backend, not a durable or production one: it holds pacts in memory, so nothing survives the process. It exists to demonstrate correct lifecycle semantics and to calibrate against — durable backends live outside this workspace and prove themselves against pacta-conformance just as this one does.

It is a pure lifecycle state machine that holds pacts, leases claims for a user-supplied duration, reclaims lapsed pacts through the normal claim path, and rotates the retainer on every claim so a stale holder cannot settle. It reads no clock — time is injected into claim and heartbeat.

Structs§

MemoryRegistry
An in-memory registry seeded with a fixed set of pacts.
NotHeld
The error a memory registry returns when a retainer is not the current holder, or when a heartbeat arrives after its lease has already lapsed.