pub struct ToolExecutionOutcome { /* private fields */ }Expand description
Domain-level result from a tool execution.
Executors supply full output and may omit its presentation-only envelope from a separate model body. Runtime owns persistence, events, and ledger updates; an absent model body preserves the full result.
Implementations§
Source§impl ToolExecutionOutcome
impl ToolExecutionOutcome
Sourcepub fn succeeded_text(content: impl Into<String>) -> Self
pub fn succeeded_text(content: impl Into<String>) -> Self
Creates a successful text result.
Sourcepub fn succeeded_json(content: impl Into<String>) -> Self
pub fn succeeded_json(content: impl Into<String>) -> Self
Creates a successful JSON result.
Sourcepub fn failed_text(content: impl Into<String>, diagnostic: ErrorInfo) -> Self
pub fn failed_text(content: impl Into<String>, diagnostic: ErrorInfo) -> Self
Creates a failed text result with a small diagnostic.
Use this when the tool ran and produced a domain-level failure that should resolve the pending call durably.
Sourcepub fn failed_json(content: impl Into<String>, diagnostic: ErrorInfo) -> Self
pub fn failed_json(content: impl Into<String>, diagnostic: ErrorInfo) -> Self
Creates a failed JSON result with a small diagnostic.
Use this when the tool ran and produced a domain-level failure that should resolve the pending call durably.
Sourcepub fn status(&self) -> ToolCallResultStatus
pub fn status(&self) -> ToolCallResultStatus
Returns the tool execution status.
Sourcepub fn content(&self) -> &ToolOutput
pub fn content(&self) -> &ToolOutput
Borrows the exact full execution output.
Runtime records this output before emitting the resolution event.
Sourcepub fn model_content(&self) -> Option<&ToolOutput>
pub fn model_content(&self) -> Option<&ToolOutput>
Borrows the optional model-facing body instead of the full output.
Runtime persists this body for request replay and compaction. Full tool
output reads and presentation retain Self::content.
Sourcepub fn with_model_text(self, content: impl Into<String>) -> Self
pub fn with_model_text(self, content: impl Into<String>) -> Self
Supplies model-facing text without changing the full result output.
Keep execution status, useful output, and completeness warnings in this body. Runtime rejects blank bodies before resolving the tool call.
Sourcepub fn with_model_json(self, content: impl Into<String>) -> Self
pub fn with_model_json(self, content: impl Into<String>) -> Self
Supplies model-facing JSON without changing the full result output.
The caller owns the JSON schema and must preserve actionable results. Runtime rejects blank bodies before resolving the tool call.
Sourcepub fn with_image(self, image: UserImageInput) -> Self
pub fn with_image(self, image: UserImageInput) -> Self
Attaches one normalized PNG image observed alongside this tool outcome.
Sourcepub fn with_images<I>(self, images: I) -> Selfwhere
I: IntoIterator<Item = UserImageInput>,
pub fn with_images<I>(self, images: I) -> Selfwhere
I: IntoIterator<Item = UserImageInput>,
Attaches normalized PNG images observed alongside this tool outcome.
Sourcepub fn images(&self) -> &[UserImageInput]
pub fn images(&self) -> &[UserImageInput]
Borrows normalized PNG images attached to this tool outcome.
Sourcepub fn diagnostic(&self) -> Option<&ErrorInfo>
pub fn diagnostic(&self) -> Option<&ErrorInfo>
Borrows the optional failure diagnostic.
Sourcepub fn execution_evidence(&self) -> Option<&ActionExecutionEvidence>
pub fn execution_evidence(&self) -> Option<&ActionExecutionEvidence>
Borrows provider-invisible evidence produced by the actual execution.
Runtime validates this internally against the approved proposal. It must not be rendered into tool results, provider continuations, or provider request payloads.
Sourcepub fn with_execution_evidence(self, evidence: ActionExecutionEvidence) -> Self
pub fn with_execution_evidence(self, evidence: ActionExecutionEvidence) -> Self
Attaches provider-invisible evidence from the actual execution.
Trait Implementations§
Source§impl Clone for ToolExecutionOutcome
impl Clone for ToolExecutionOutcome
Source§impl Debug for ToolExecutionOutcome
impl Debug for ToolExecutionOutcome
impl Eq for ToolExecutionOutcome
Source§impl PartialEq for ToolExecutionOutcome
impl PartialEq for ToolExecutionOutcome
impl StructuralPartialEq for ToolExecutionOutcome
Auto Trait Implementations§
impl Forget for ToolExecutionOutcome
impl Freeze for ToolExecutionOutcome
impl Move for ToolExecutionOutcome
impl RefUnwindSafe for ToolExecutionOutcome
impl Send for ToolExecutionOutcome
impl Sync for ToolExecutionOutcome
impl Unpin for ToolExecutionOutcome
impl UnsafeUnpin for ToolExecutionOutcome
impl UnwindSafe for ToolExecutionOutcome
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<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.