Skip to main content

ProcessCompletionAuthority

Enum ProcessCompletionAuthority 

Source
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.

Fields

§granted_to: String
§

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.

Fields

§workflow_key: String
§

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

Source

pub fn external_owner(granted_to: impl Into<String>) -> Self

Construct ExternalOwner authority naming the session-scope identity that holds the handle grant.

Source

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.

Source

pub fn label(&self) -> &'static str

Short, stable label for diagnostics.

Source

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

Source§

fn clone(&self) -> ProcessCompletionAuthority

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProcessCompletionAuthority

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ProcessCompletionAuthority

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ProcessCompletionAuthority

Source§

impl PartialEq for ProcessCompletionAuthority

Source§

fn eq(&self, other: &ProcessCompletionAuthority) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ProcessCompletionAuthority

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProcessCompletionAuthority

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more