pub enum ProcessCompletionAuthority {
ExternalOwner {
granted_to: String,
},
WorkflowKey {
workflow_key: String,
},
ReconciledAbandon,
}Expand description
Authority under which an unleased terminal completion
(ProcessRegistry::complete_process)
is written.
Lash-owned workers fence terminal writes with a process lease
(complete_process_with_lease), which the store validates against the
persisted (owner, lease_token, fencing_token). The unleased path is
reserved for writers whose single-writer discipline lives outside the Lash
lease. In-process Rust cannot make such a token unforgeable; the value of
this type is instead explicitness + a single validation choke point per
backend + audit evidence on the terminal write. Every backend calls
validate against the row’s declared
RecoveryDisposition inside its completion operation, and records the
authority on the durable terminal event (see terminal_append_request).
There is deliberately no Default: a caller must name its authority, the
same footgun-prevention stance the runtime takes elsewhere.
Variants§
ExternalOwner
An external actor closes an RecoveryDisposition::ExternallyOwned row
it holds a handle grant for (the shell.start detach path, ADR 0019).
granted_to is the session-scope identity the caller verified holds the
grant — the audit trail for who closed the row out of band. Rejected on
any lash-executed disposition: those have a lease-fenced single writer.
WorkflowKey
A workflow-key-coalesced substrate (e.g. Restate keyed by process_id)
completes a row it ran itself. Its single-writer discipline is the
engine’s per-key coalescing, not a Lash lease; workflow_key records the
key that served as that discipline. Valid for the lash-executed
dispositions (RecoveryDisposition::Rerunnable and
RecoveryDisposition::OwnerBound, which Restate runs), and rejected on
RecoveryDisposition::ExternallyOwned rows — a substrate never runs
one, so it may not close one.
ReconciledAbandon
The sweep reconciled a durable Abandon Request on an
RecoveryDisposition::ExternallyOwned row (whose lease had lapsed, or
which Lash never leased) into an
ProcessTerminalState::Abandoned terminal. Carries no owner: the
closure is authorized by the recorded request, not a live writer. Only
ever writes an Abandoned terminal.
Implementations§
Source§impl ProcessCompletionAuthority
impl ProcessCompletionAuthority
Sourcepub fn external_owner(granted_to: impl Into<String>) -> Self
pub fn external_owner(granted_to: impl Into<String>) -> Self
Construct ExternalOwner authority naming the
session-scope identity that holds the handle grant.
Sourcepub fn workflow_key(workflow_key: impl Into<String>) -> Self
pub fn workflow_key(workflow_key: impl Into<String>) -> Self
Construct WorkflowKey authority naming the
coalescing key that serves as the substrate’s single-writer discipline.
Sourcepub fn validate(
&self,
process_id: &str,
disposition: RecoveryDisposition,
await_output: &ProcessAwaitOutput,
) -> Result<(), PluginError>
pub fn validate( &self, process_id: &str, disposition: RecoveryDisposition, await_output: &ProcessAwaitOutput, ) -> Result<(), PluginError>
Validate this authority against the row’s declared recovery disposition
and the terminal outcome being written. This is the single per-backend
choke point that keeps unleased completion honest: each complete_process
implementation calls it before appending the terminal event, so the
disposition×authority contract is enforced uniformly across memory,
SQLite, and Postgres rather than at each scattered caller.
Trait Implementations§
Source§impl Clone for ProcessCompletionAuthority
impl Clone for ProcessCompletionAuthority
Source§fn clone(&self) -> ProcessCompletionAuthority
fn clone(&self) -> ProcessCompletionAuthority
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessCompletionAuthority
impl Debug for ProcessCompletionAuthority
Source§impl<'de> Deserialize<'de> for ProcessCompletionAuthority
impl<'de> Deserialize<'de> for ProcessCompletionAuthority
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ProcessCompletionAuthority
impl StructuralPartialEq for ProcessCompletionAuthority
Auto Trait Implementations§
impl Freeze for ProcessCompletionAuthority
impl RefUnwindSafe for ProcessCompletionAuthority
impl Send for ProcessCompletionAuthority
impl Sync for ProcessCompletionAuthority
impl Unpin for ProcessCompletionAuthority
impl UnsafeUnpin for ProcessCompletionAuthority
impl UnwindSafe for ProcessCompletionAuthority
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.