pub struct ToolResult {
pub code: i32,
pub stdout: String,
pub stderr: String,
pub data: Option<Value>,
pub output: Option<OutputData>,
pub content_type: Option<String>,
pub baggage: BTreeMap<String, String>,
pub latch: Option<Box<LatchRequest>>,
}Expand description
Result from tool execution via backend.
Fields§
§code: i32Exit code (0 = success).
stdout: StringStandard output.
stderr: StringStandard error.
data: Option<Value>Structured data (if any).
output: Option<OutputData>Structured output data for rendering (preserved from ExecResult).
content_type: Option<String>MIME content type hint (propagated from ExecResult).
baggage: BTreeMap<String, String>Opaque key-value context (propagated from ExecResult).
latch: Option<Box<LatchRequest>>A pending confirmation-latch request (propagated from ExecResult), so a
backend-tool latch survives the ExecResult↔ToolResult roundtrip. Its own
typed field — never folded into data. Boxed to match ExecResult.latch
(keeps the roundtrip a direct move; see that field for why).
Implementations§
Source§impl ToolResult
impl ToolResult
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl From<ExecResult> for ToolResult
impl From<ExecResult> for ToolResult
Source§fn from(exec: ExecResult) -> ToolResult
fn from(exec: ExecResult) -> ToolResult
Source§impl From<ToolResult> for ExecResult
impl From<ToolResult> for ExecResult
Source§fn from(result: ToolResult) -> ExecResult
fn from(result: ToolResult) -> ExecResult
The symmetric peer of From<ExecResult> for ToolResult above — every
field that direction preserves, this direction must preserve too, or a
backend-registered tool’s structured data/content_type/baggage
silently vanishes crossing back into the kernel (the embedder seam:
x=$(embedder_tool) and for r in $(embedder_tool) need .data to
see typed results, not just stdout text).
data uses json_to_value_no_envelope rather than the internal
round-trip conversion: a backend tool’s JSON is external input, so an
object shaped like the byte envelope must stay a plain record, never
silently auto-decode to Value::Bytes.
Auto Trait Implementations§
impl Freeze for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin for ToolResult
impl UnwindSafe for ToolResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.