pub struct TypedAgent<I, O> { /* private fields */ }Expand description
Strongly typed codec bound to a fully frozen agent and schema registry.
TypedAgent prepares and validates durable request/result values. Actual
execution remains the responsibility of the durable admission, invocation,
graph Driver, lifecycle, and crate::DurableAgentLoop boundaries.
Implementations§
Source§impl<I, O> TypedAgent<I, O>
impl<I, O> TypedAgent<I, O>
Sourcepub const fn descriptor(&self) -> &AgentDescriptor
pub const fn descriptor(&self) -> &AgentDescriptor
Returns the exact immutable agent descriptor.
Sourcepub const fn schema_registry(&self) -> &Arc<JsonSchemaRegistry> ⓘ
pub const fn schema_registry(&self) -> &Arc<JsonSchemaRegistry> ⓘ
Returns the complete offline schema registry used for local validation.
Source§impl<I, O> TypedAgent<I, O>where
I: Serialize,
impl<I, O> TypedAgent<I, O>where
I: Serialize,
Sourcepub fn prepare_request(
&self,
input: &I,
budget_limits: BudgetLimits,
) -> Result<AgentRequest, TypedAgentInputError>
pub fn prepare_request( &self, input: &I, budget_limits: BudgetLimits, ) -> Result<AgentRequest, TypedAgentInputError>
Serializes and locally schema-validates one typed request under finite JSON limits. Tenant/run/thread/invocation identity is intentionally not accepted here; trusted run admission assigns it later.
§Errors
Returns TypedAgentInputError when serialization is unsuccessful,
resource limits are exceeded, or the value violates the generated schema.
Source§impl<I, O> TypedAgent<I, O>where
O: DeserializeOwned,
impl<I, O> TypedAgent<I, O>where
O: DeserializeOwned,
Sourcepub fn decode_result(
&self,
result: &AgentResult,
expected_provenance: &AgentResultProvenance,
request: &AgentRequest,
budget: &ResolvedBudget,
) -> Result<O, TypedAgentOutputError>
pub fn decode_result( &self, result: &AgentResult, expected_provenance: &AgentResultProvenance, request: &AgentRequest, budget: &ResolvedBudget, ) -> Result<O, TypedAgentOutputError>
Revalidates trusted admission/result provenance, complete budget
accounting, the pinned output schema, and finally decodes O.
§Errors
Returns TypedAgentOutputError for substituted durable evidence,
budget/accounting failure, schema rejection, or typed decoding failure.
Trait Implementations§
Source§impl<I, O> Clone for TypedAgent<I, O>
impl<I, O> Clone for TypedAgent<I, O>
Auto Trait Implementations§
impl<I, O> !RefUnwindSafe for TypedAgent<I, O>
impl<I, O> !UnwindSafe for TypedAgent<I, O>
impl<I, O> Forget for TypedAgent<I, O>
impl<I, O> Freeze for TypedAgent<I, O>
impl<I, O> Move for TypedAgent<I, O>
impl<I, O> Send for TypedAgent<I, O>
impl<I, O> Sync for TypedAgent<I, O>
impl<I, O> Unpin for TypedAgent<I, O>
impl<I, O> UnsafeUnpin for TypedAgent<I, O>
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