pub struct SubTask {
pub id: String,
pub name: String,
pub description: String,
pub priority: u32,
pub dependencies: Vec<String>,
pub estimated_complexity: u32,
pub tool: Option<String>,
pub tool_args: Option<Value>,
pub validation_criteria: Vec<String>,
pub fallback: Option<Box<SubTask>>,
}Expand description
子任务定义
Fields§
§id: String子任务ID
name: String子任务名称
description: String子任务描述
priority: u32执行优先级 (0最高)
dependencies: Vec<String>依赖的任务ID列表
estimated_complexity: u32预估复杂度 (1-10)
tool: Option<String>执行工具
tool_args: Option<Value>工具参数
validation_criteria: Vec<String>验证条件
fallback: Option<Box<SubTask>>失败时的替代方案
Implementations§
Source§impl SubTask
impl SubTask
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, ) -> Self
创建新的子任务
Sourcepub fn with_priority(self, priority: u32) -> Self
pub fn with_priority(self, priority: u32) -> Self
设置优先级
Sourcepub fn with_dependency(self, dep_id: impl Into<String>) -> Self
pub fn with_dependency(self, dep_id: impl Into<String>) -> Self
添加依赖
Sourcepub fn with_validation(self, criteria: impl Into<String>) -> Self
pub fn with_validation(self, criteria: impl Into<String>) -> Self
设置验证条件
Sourcepub fn with_fallback(self, fallback: SubTask) -> Self
pub fn with_fallback(self, fallback: SubTask) -> Self
设置失败替代方案
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SubTask
impl<'de> Deserialize<'de> for SubTask
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 SubTask
impl RefUnwindSafe for SubTask
impl Send for SubTask
impl Sync for SubTask
impl Unpin for SubTask
impl UnsafeUnpin for SubTask
impl UnwindSafe for SubTask
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