pub struct Receipts { /* private fields */ }Implementations§
Source§impl Receipts
impl Receipts
Sourcepub async fn cached_execution(
&self,
key: &str,
) -> Result<Option<Execution>, String>
pub async fn cached_execution( &self, key: &str, ) -> Result<Option<Execution>, String>
The key’s latest record; a hit updates its last use.
Sourcepub async fn published_execution(
&self,
execution_id: &str,
) -> Result<Option<Execution>, String>
pub async fn published_execution( &self, execution_id: &str, ) -> Result<Option<Execution>, String>
The saved execution eligible for publication; speculative Runs hold publication until blocked work has been withdrawn. Mirrors never publish again.
Sourcepub async fn claim_execution(
&self,
execution: &Execution,
keyed: bool,
waiting_for: Option<&ExecutionId>,
allow_start: bool,
capacity: Option<Capacity>,
) -> Result<Claim, String>
pub async fn claim_execution( &self, execution: &Execution, keyed: bool, waiting_for: Option<&ExecutionId>, allow_start: bool, capacity: Option<Capacity>, ) -> Result<Claim, String>
Claim an execution for its request. A keyed claim (a key, not forced) first reuses
the key’s latest record or waits for its live execution with the same profile. Starting needs
allow_start and, on a backend with a machine-wide limit, a free slot: the slots the
backend’s RUNNING executions hold are counted and this execution inserted RUNNING in
one write transaction. Mutex tags are also checked and held in that transaction,
including for unkeyed and forced executions. An unkeyed or forced execution without
a limit or mutex tags is saved when it completes.
pub async fn reuse_execution(&self, request: &Request) -> Result<(), String>
pub async fn complete_execution( &self, execution: &Execution, request: &Request, ) -> Result<(), String>
Sourcepub async fn mirror_execution(
&self,
execution: &Execution,
) -> Result<Option<Execution>, String>
pub async fn mirror_execution( &self, execution: &Execution, ) -> Result<Option<Execution>, String>
Add a remote result to its key’s history as a self-contained execution when it
completed after the key’s latest local record, which it then replaces as the one reused;
None when the local record is as new. The mirrored record settles a local Human wait
for the key.
Source§impl Receipts
impl Receipts
Sourcepub async fn close(self) -> Result<(), String>
pub async fn close(self) -> Result<(), String>
Close the shared SQLite connection before releasing its state files. Any cloned receipts also become closed; call this only after all operations on them finish.
pub async fn open(state: &Path, repo: &Path) -> Result<Self, String>
Sourcepub async fn state_id(&self) -> Result<StateId, String>
pub async fn state_id(&self) -> Result<StateId, String>
This state’s stable id (read_state_id).