#[non_exhaustive]pub enum Directive {
Emit {
event: AgentEvent,
},
SpawnAgent {
name: String,
config: Value,
},
StopChild {
name: String,
},
Schedule {
action: String,
delay: Duration,
},
RunInstruction {
instruction: String,
input: Value,
},
Cron {
expression: String,
action: String,
},
Stop {
reason: Option<String>,
},
SpawnTask {
description: String,
input: Value,
},
StopTask {
task_id: String,
},
Custom {
payload: Box<dyn DirectivePayload>,
},
}Expand description
Directive - typed effect description returned by agent nodes.
Directives describe side effects without executing them, enabling pure unit testing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Emit
Emit an event to the event stream.
Fields
§
event: AgentEventEvent to emit.
SpawnAgent
Request spawning a child agent.
StopChild
Request stopping a child agent.
Schedule
Schedule a delayed action.
RunInstruction
Request runtime to execute instruction and route result back.
Cron
Schedule recurring action.
Stop
Request agent stop.
SpawnTask
Spawn a background task.
StopTask
Cancel a background task.
Custom
User-defined directive (requires typetag registration).
Fields
§
payload: Box<dyn DirectivePayload>Custom directive payload.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Directive
impl<'de> Deserialize<'de> for Directive
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 Directive
impl !RefUnwindSafe for Directive
impl Send for Directive
impl Sync for Directive
impl Unpin for Directive
impl UnsafeUnpin for Directive
impl !UnwindSafe for Directive
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