pub struct AgentTask {
pub objective: String,
pub expected_output: Option<String>,
pub allowed_tools: Vec<String>,
}Expand description
Child agent task (P2-5)
An explicit task dispatched to a child agent, carrying two layers of
constraint beyond a bare String:
expected_output: the expected deliverable, so the child agent aligns its result shape;allowed_tools: the child agent’s tool allowlist (actual assembly is the consumer’s responsibility).
Can degrade to a bare objective string via [From<AgentTask> for String]
for Input=String orchestrators / executors.
Fields§
§objective: StringTask objective: a one-sentence description of what to do.
expected_output: Option<String>Expected output (optional): the result’s shape / key points, for the child agent to align to.
allowed_tools: Vec<String>Allowed tool allowlist (empty = no restriction).
Implementations§
Source§impl AgentTask
impl AgentTask
Sourcepub fn with_expected_output(self, expected_output: impl Into<String>) -> Self
pub fn with_expected_output(self, expected_output: impl Into<String>) -> Self
Declares the expected output.
Sourcepub fn with_allowed_tools(
self,
tools: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_allowed_tools( self, tools: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Declares the allowed-tool allowlist (overwrite semantics).
Sourcepub fn expected_output(&self) -> Option<&str>
pub fn expected_output(&self) -> Option<&str>
Expected output, if any.
Sourcepub fn allowed_tools(&self) -> &[String]
pub fn allowed_tools(&self) -> &[String]
Allowed-tool allowlist.
Sourcepub fn is_tool_restricted(&self) -> bool
pub fn is_tool_restricted(&self) -> bool
Whether tools are restricted (allowlist non-empty).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentTask
impl<'de> Deserialize<'de> for AgentTask
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 AgentTask
impl RefUnwindSafe for AgentTask
impl Send for AgentTask
impl Sync for AgentTask
impl Unpin for AgentTask
impl UnsafeUnpin for AgentTask
impl UnwindSafe for AgentTask
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