#[non_exhaustive]pub struct ExecuteResponse {
pub request_id: Option<String>,
pub status: ExecutionStatus,
pub output: Option<Value>,
pub error: Option<String>,
pub metadata: ExecutionMetadata,
}Expand description
Response from a tool execution.
Contains the execution result, any errors, and metadata about resource consumption and sanitization.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request_id: Option<String>Caller-assigned request ID for correlation. Echoed back if provided.
status: ExecutionStatusOverall execution outcome.
output: Option<Value>Tool output on success. None when status is not Ok.
error: Option<String>Human-readable error message on failure.
metadata: ExecutionMetadataExecution telemetry (timing, fuel, logs, sanitization).
Implementations§
Source§impl ExecuteResponse
impl ExecuteResponse
Sourcepub fn ok(output: Value, metadata: ExecutionMetadata) -> Self
pub fn ok(output: Value, metadata: ExecutionMetadata) -> Self
Create a successful response with the given output and metadata.
Sourcepub fn error(error: impl Into<String>, metadata: ExecutionMetadata) -> Self
pub fn error(error: impl Into<String>, metadata: ExecutionMetadata) -> Self
Create an error response with the given message and metadata.
Sourcepub fn with_request_id(self, id: impl Into<String>) -> Self
pub fn with_request_id(self, id: impl Into<String>) -> Self
Set the request ID for correlation.
Trait Implementations§
Source§impl Clone for ExecuteResponse
impl Clone for ExecuteResponse
Source§fn clone(&self) -> ExecuteResponse
fn clone(&self) -> ExecuteResponse
Returns a duplicate of the value. Read more
1.0.0 · 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 ExecuteResponse
impl Debug for ExecuteResponse
Source§impl<'de> Deserialize<'de> for ExecuteResponse
impl<'de> Deserialize<'de> for ExecuteResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExecuteResponse
impl RefUnwindSafe for ExecuteResponse
impl Send for ExecuteResponse
impl Sync for ExecuteResponse
impl Unpin for ExecuteResponse
impl UnsafeUnpin for ExecuteResponse
impl UnwindSafe for ExecuteResponse
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