pub struct ExecutionResult {
pub execution_id: String,
pub agent_id: String,
pub status: ExecutionStatus,
pub output: Option<AgentOutput>,
pub error: Option<String>,
pub duration_ms: u64,
pub retries: usize,
pub metadata: HashMap<String, Value>,
}Expand description
执行结果
Fields§
§execution_id: String执行 ID
agent_id: StringAgent ID
status: ExecutionStatus状态
output: Option<AgentOutput>输出
error: Option<String>错误信息
duration_ms: u64执行时间 (毫秒)
retries: usize重试次数
metadata: HashMap<String, Value>元数据
Implementations§
Source§impl ExecutionResult
impl ExecutionResult
Sourcepub fn success(
execution_id: String,
agent_id: String,
output: AgentOutput,
duration_ms: u64,
) -> Self
pub fn success( execution_id: String, agent_id: String, output: AgentOutput, duration_ms: u64, ) -> Self
创建成功结果
Sourcepub fn failure(
execution_id: String,
agent_id: String,
error: String,
duration_ms: u64,
) -> Self
pub fn failure( execution_id: String, agent_id: String, error: String, duration_ms: u64, ) -> Self
创建失败结果
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
是否成功
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
添加元数据
Trait Implementations§
Source§impl Clone for ExecutionResult
impl Clone for ExecutionResult
Source§fn clone(&self) -> ExecutionResult
fn clone(&self) -> ExecutionResult
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 ExecutionResult
impl Debug for ExecutionResult
Source§impl<'de> Deserialize<'de> for ExecutionResult
impl<'de> Deserialize<'de> for ExecutionResult
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 ExecutionResult
impl RefUnwindSafe for ExecutionResult
impl Send for ExecutionResult
impl Sync for ExecutionResult
impl Unpin for ExecutionResult
impl UnsafeUnpin for ExecutionResult
impl UnwindSafe for ExecutionResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more