pub struct ToolExecutionInterceptOutcome {
pub result: Value,
pub annotation: Option<Value>,
pub pending_marks: Vec<PendingMarkSpec>,
}Expand description
Canonical result returned by a tool execution intercept.
result and annotation are returned to the remaining middleware and
application. pending_marks are Relay-owned lifecycle metadata retained
separately and emitted after the tool-end event.
Fields§
§result: ValueTool result returned to the remaining middleware and application.
annotation: Option<Value>Optional opaque metadata associated with the result.
pending_marks: Vec<PendingMarkSpec>Ordered marks for the managed tool lifecycle owner to emit.
Implementations§
Source§impl ToolExecutionInterceptOutcome
impl ToolExecutionInterceptOutcome
Sourcepub fn new(result: Value) -> ToolExecutionInterceptOutcome
pub fn new(result: Value) -> ToolExecutionInterceptOutcome
Create an outcome without pending marks.
Sourcepub fn annotated(
result: Value,
annotation: Value,
) -> ToolExecutionInterceptOutcome
pub fn annotated( result: Value, annotation: Value, ) -> ToolExecutionInterceptOutcome
Create an outcome with an opaque annotation and no pending marks.
Sourcepub fn with_annotation(self, annotation: Value) -> ToolExecutionInterceptOutcome
pub fn with_annotation(self, annotation: Value) -> ToolExecutionInterceptOutcome
Replace the opaque annotation while preserving the application result and pending marks.
Sourcepub fn without_annotation(self) -> ToolExecutionInterceptOutcome
pub fn without_annotation(self) -> ToolExecutionInterceptOutcome
Remove the annotation while preserving the application result and pending marks.
Sourcepub fn into_execution_result(self) -> ToolExecutionResult
pub fn into_execution_result(self) -> ToolExecutionResult
Convert the intercept outcome to its application-visible result.
Sourcepub fn with_pending_mark(
self,
mark: PendingMarkSpec,
) -> ToolExecutionInterceptOutcome
pub fn with_pending_mark( self, mark: PendingMarkSpec, ) -> ToolExecutionInterceptOutcome
Append one pending mark while preserving callback order.
Trait Implementations§
Source§impl Clone for ToolExecutionInterceptOutcome
impl Clone for ToolExecutionInterceptOutcome
Source§fn clone(&self) -> ToolExecutionInterceptOutcome
fn clone(&self) -> ToolExecutionInterceptOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more