pub struct ToolExecutionResult {
pub result: Value,
pub annotation: Option<Value>,
}Expand description
Canonical application-visible result of tool execution.
Relay transports result and annotation without interpreting either
value. The annotation is an adjacent metadata channel and does not impose a
schema on the application-owned result.
Fields§
§result: ValueApplication-owned tool result.
annotation: Option<Value>Optional opaque metadata associated with the result.
Implementations§
Source§impl ToolExecutionResult
impl ToolExecutionResult
Sourcepub fn new(result: Value) -> ToolExecutionResult
pub fn new(result: Value) -> ToolExecutionResult
Create a result without an annotation.
Sourcepub fn annotated(result: Value, annotation: Value) -> ToolExecutionResult
pub fn annotated(result: Value, annotation: Value) -> ToolExecutionResult
Create a result with an opaque annotation.
Sourcepub fn with_annotation(self, annotation: Value) -> ToolExecutionResult
pub fn with_annotation(self, annotation: Value) -> ToolExecutionResult
Replace the opaque annotation while preserving the application result.
Sourcepub fn without_annotation(self) -> ToolExecutionResult
pub fn without_annotation(self) -> ToolExecutionResult
Remove the annotation while preserving the application result.
Trait Implementations§
Source§impl Clone for ToolExecutionResult
impl Clone for ToolExecutionResult
Source§fn clone(&self) -> ToolExecutionResult
fn clone(&self) -> ToolExecutionResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolExecutionResult
impl Debug for ToolExecutionResult
Source§impl<'de> Deserialize<'de> for ToolExecutionResult
impl<'de> Deserialize<'de> for ToolExecutionResult
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolExecutionResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolExecutionResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ToolExecutionResult> for ToolExecutionInterceptOutcome
impl From<ToolExecutionResult> for ToolExecutionInterceptOutcome
Source§fn from(result: ToolExecutionResult) -> ToolExecutionInterceptOutcome
fn from(result: ToolExecutionResult) -> ToolExecutionInterceptOutcome
Converts to this type from the input type.
Source§impl From<Value> for ToolExecutionResult
impl From<Value> for ToolExecutionResult
Source§fn from(result: Value) -> ToolExecutionResult
fn from(result: Value) -> ToolExecutionResult
Converts to this type from the input type.
Source§impl PartialEq for ToolExecutionResult
impl PartialEq for ToolExecutionResult
Source§impl Serialize for ToolExecutionResult
impl Serialize for ToolExecutionResult
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ToolExecutionResult
impl RefUnwindSafe for ToolExecutionResult
impl Send for ToolExecutionResult
impl Sync for ToolExecutionResult
impl Unpin for ToolExecutionResult
impl UnsafeUnpin for ToolExecutionResult
impl UnwindSafe for ToolExecutionResult
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
Mutably borrows from an owned value. Read more