pub enum ControlOp {
Spawn {
args: Box<SpawnArgs>,
reply: Sender<Result<String, String>>,
},
Status {
run_id: String,
reply: Sender<Option<AgentStatus>>,
},
Pause {
run_id: String,
reply: Sender<bool>,
},
Resume {
run_id: String,
reply: Sender<bool>,
},
Cancel {
run_id: String,
reply: Sender<bool>,
},
List {
reply: Sender<Vec<(String, AgentStatus)>>,
},
Message {
agent_id: String,
content: String,
target_region: Option<String>,
reply: Sender<bool>,
},
ListInteractions {
reply: Sender<Vec<(String, InteractionRequest)>>,
},
AnswerInteraction {
response: InteractionResponse,
reply: Sender<bool>,
},
CancelInteraction {
request_id: String,
reply: Sender<bool>,
},
Shutdown {
reply: Sender<bool>,
},
}Expand description
A control operation addressed to the host, each carrying a oneshot channel the host replies on. Agents are addressed by run id.
Variants§
Spawn
Spawn a new agent. Reply is the run id on success, or an error message.
Fields
Status
The status of a run, or None if there is no such run.
Pause
Pause a run. Reply is false if there is no such (live) run.
Resume
Resume a paused run. Reply is false if there is no such (live) run.
Cancel
Cancel a run. Reply is false if there is no such (live) run.
List
List every known live run and its status.
Fields
reply: Sender<Vec<(String, AgentStatus)>>Reply channel.
Message
Deliver a message to a running agent (by agent id). Reply is false if the
world’s message channel is closed.
Fields
ListInteractions
List every open interaction awaiting an answer, as (agent_id, request).
Fields
reply: Sender<Vec<(String, InteractionRequest)>>Reply channel.
AnswerInteraction
Answer an open interaction. Reply is false if no such request is open.
Fields
response: InteractionResponseThe answer (its request_id selects the interaction).
CancelInteraction
Cancel an open interaction (its asker wakes with a neutral response).
Reply is false if no such request is open.
Shutdown
Shut the daemon down: signal the world’s shutdown so the serve loop
returns. Reply is sent (true) before the shutdown is triggered.
Auto Trait Implementations§
impl !RefUnwindSafe for ControlOp
impl !UnwindSafe for ControlOp
impl Freeze for ControlOp
impl Send for ControlOp
impl Sync for ControlOp
impl Unpin for ControlOp
impl UnsafeUnpin for ControlOp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.