Skip to main content

Crate pacta_contract

Crate pacta_contract 

Source
Expand description

The isolated core contract for Pacta.

Pacta operates on three axioms:

  1. Registry is Lifecycle (no business logic, no retry/delay logic).
  2. Execution is Middleware.
  3. This contract has no dependency on other workspace crates.

Modules§

kernel
The sans-I/O lifecycle kernel.

Structs§

Claim
A claimed pact and the retainer required to settle it.
Pact
A durable obligation, generated from a Signal, ready to be executed. Note the deliberate absence of attempts, delay, and priority.
Retainer
A retainer: the authority token a registry issues with a claim and validates when settling it. Authority is registry-validated — a forged identifier does not match an issued claim — not proven by the type system. Construct via Retainer::new and read the identifier via Retainer::id. Derives PartialEq/Eq/Hash so a durable backend can index lease state by holder identity — the orphan rule makes providing these the contract’s responsibility.
Timestamp
A point in time as milliseconds since an epoch the runtime chooses. This is a pure value: the core names time but never reads it. There is deliberately no now constructor — a runtime obtains the current time and injects it, keeping lease decisions deterministic and testable.

Enums§

Outcome
The lifecycle outcome an execution produces for a claimed pact.

Traits§

Registry
The Registry manages the lifecycle of Pacts. It is a pure state machine.

Type Aliases§

Settlement
The lifecycle conclusion applied to a claim, currently a fulfilled or breached Outcome.