pub struct DurableAgentRuns { /* private fields */ }Expand description
Public durable Agent admission and run/result query facade.
This value keeps the exact executable/schema deployment registry beside the store. Every read reloads the immutable admission and current lifecycle in one repeatable-read snapshot, then revalidates request, authority, initial state, audit event, graph closure, terminal output, provenance, and budget before returning a public value.
Implementations§
Source§impl DurableAgentRuns
impl DurableAgentRuns
Sourcepub fn new(
store: PostgresStore,
registry: ExecutableGraphRegistry,
) -> Result<Self, DurableAgentRunsBuildError>
pub fn new( store: PostgresStore, registry: ExecutableGraphRegistry, ) -> Result<Self, DurableAgentRunsBuildError>
Binds the durability provider to one immutable executable deployment.
§Errors
Rejects an unavailable or malformed standard Agent-admission schema.
Sourcepub async fn admit(
&self,
request: DurableAgentAdmissionRequest,
) -> Result<AgentRunAdmissionOutcome, DurableAgentRunsError>
pub async fn admit( &self, request: DurableAgentAdmissionRequest, ) -> Result<AgentRunAdmissionOutcome, DurableAgentRunsError>
Validates, atomically admits, and returns a public run snapshot.
Ambiguous retries must retain the exact DurableAgentAdmissionRequest.
Ingress idempotency-key allocation is deliberately a stronger boundary
and is not emulated with process-local memory by this method.
§Errors
Returns a closed admission, storage, deployment, schema, integrity, or terminal-accounting failure.
Sourcepub async fn submit(
&self,
key: &AgentSubmissionKey,
request: DurableAgentAdmissionRequest,
) -> Result<AgentRunAdmissionOutcome, DurableAgentRunsError>
pub async fn submit( &self, key: &AgentSubmissionKey, request: DurableAgentAdmissionRequest, ) -> Result<AgentRunAdmissionOutcome, DurableAgentRunsError>
Submits one candidate under a durable tenant-scoped idempotency key.
Unlike Self::admit, callers do not retain candidate IDs after an
ambiguous response. They recreate the same caller content with the same
key; the provider returns the originally selected run even if the new
request contains a fresh crate::AgentRunIds bundle.
§Errors
Reusing a key for changed content returns a durable conflict. Deployment, schema, integrity, and database failures remain closed and payload-safe.
Sourcepub async fn load(
&self,
tenant_id: &TenantId,
run_id: RunId,
) -> Result<AgentRunSnapshot, DurableAgentRunsError>
pub async fn load( &self, tenant_id: &TenantId, run_id: RunId, ) -> Result<AgentRunSnapshot, DurableAgentRunsError>
Loads one tenant-scoped Agent run and fully revalidates its public view.
Calling services remain responsible for authenticating and authorizing the tenant/run lookup before invoking this trusted server-side method.
§Errors
Returns not-found, corruption, deployment drift, schema rejection, invalid terminal accounting, or database failures.
Sourcepub async fn load_by_key(
&self,
tenant_id: &TenantId,
key: &AgentSubmissionKey,
) -> Result<AgentRunSnapshot, DurableAgentRunsError>
pub async fn load_by_key( &self, tenant_id: &TenantId, key: &AgentSubmissionKey, ) -> Result<AgentRunSnapshot, DurableAgentRunsError>
Resolves an ingress key and loads its current fully verified public run.
§Errors
Returns key-not-found, corruption, deployment drift, schema rejection, invalid terminal result, or database failures.
Trait Implementations§
Source§impl Clone for DurableAgentRuns
impl Clone for DurableAgentRuns
Auto Trait Implementations§
impl !RefUnwindSafe for DurableAgentRuns
impl !UnwindSafe for DurableAgentRuns
impl Forget for DurableAgentRuns
impl Freeze for DurableAgentRuns
impl Move for DurableAgentRuns
impl Send for DurableAgentRuns
impl Sync for DurableAgentRuns
impl Unpin for DurableAgentRuns
impl UnsafeUnpin for DurableAgentRuns
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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