pub struct ToolExecutionResponse {
pub data: Value,
pub error: Option<String>,
pub log_id: String,
pub successful: bool,
}Expand description
Response from tool execution
Contains the result of a tool execution, including data, error information, and execution metadata.
§Fields
data- The execution result dataerror- Error message if execution failedlog_id- Log ID for debugging and tracingsuccessful- Whether the execution was successful (derived from error field)
§Example
use composio_sdk::models::ToolExecutionResponse;
if response.is_successful() {
println!("Success: {:?}", response.data);
} else {
eprintln!("Error: {}", response.error.unwrap());
}Fields§
§data: ValueExecution result data
error: Option<String>Error message if execution failed
log_id: StringLog ID for debugging and tracing
successful: boolWhether the execution was successful This field is computed from the error field during deserialization
Implementations§
Source§impl ToolExecutionResponse
impl ToolExecutionResponse
Sourcepub fn is_successful(&self) -> bool
pub fn is_successful(&self) -> bool
Check if the execution was successful
Returns true if there is no error, false otherwise.
§Example
if response.is_successful() {
println!("Tool executed successfully!");
}Trait Implementations§
Source§impl Clone for ToolExecutionResponse
impl Clone for ToolExecutionResponse
Source§fn clone(&self) -> ToolExecutionResponse
fn clone(&self) -> ToolExecutionResponse
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 ToolExecutionResponse
impl Debug for ToolExecutionResponse
Source§impl<'de> Deserialize<'de> for ToolExecutionResponse
impl<'de> Deserialize<'de> for ToolExecutionResponse
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 ToolExecutionResponse
impl RefUnwindSafe for ToolExecutionResponse
impl Send for ToolExecutionResponse
impl Sync for ToolExecutionResponse
impl Unpin for ToolExecutionResponse
impl UnsafeUnpin for ToolExecutionResponse
impl UnwindSafe for ToolExecutionResponse
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