pub struct PromiseId(/* private fields */);Expand description
Reference to an external-completion handle (HITL, A2A async, subagent result).
A PromiseId is not a bearer capability: resolving a promise additionally requires a
separate high-entropy resolver token (INV-9). The id is a UUIDv7 so it is unguessable for
practical purposes and time-ordered for indexing.
§Examples
use zeph_durable::PromiseId;
let id = PromiseId::new();
assert_ne!(id, PromiseId::new());Implementations§
Source§impl PromiseId
impl PromiseId
Sourcepub fn derive(execution_id: ExecutionId, step_id: StepId) -> Self
pub fn derive(execution_id: ExecutionId, step_id: StepId) -> Self
Derive the deterministic promise id for a (execution_id, step_id) position.
Used by promise() so a resumed execution re-derives the same id at the same program point
and re-attaches to the pending durable_promises row instead of minting an orphan. The id is
guessable from the execution journal, but that is harmless: a PromiseId is not a bearer
capability (INV-9) — resolution requires the separate high-entropy resolver token.
§Examples
use zeph_durable::{ExecutionId, PromiseId, StepId};
let exec = ExecutionId::new();
let a = PromiseId::derive(exec, StepId::new(3));
let b = PromiseId::derive(exec, StepId::new(3));
assert_eq!(a, b, "the same position derives the same promise id");
assert_ne!(a, PromiseId::derive(exec, StepId::new(4)));Trait Implementations§
impl Copy for PromiseId
Source§impl<'de> Deserialize<'de> for PromiseId
impl<'de> Deserialize<'de> for PromiseId
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PromiseId
impl StructuralPartialEq for PromiseId
Auto Trait Implementations§
impl Freeze for PromiseId
impl RefUnwindSafe for PromiseId
impl Send for PromiseId
impl Sync for PromiseId
impl Unpin for PromiseId
impl UnsafeUnpin for PromiseId
impl UnwindSafe for PromiseId
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
Mutably borrows from an owned value. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more