pub struct AgentHandle {
pub sender: Sender<String>,
pub receiver: Receiver<AgentEvent>,
pub kill_tx: Option<Sender<()>>,
pub session_id: Option<String>,
pub stdin_tx: Sender<String>,
}Expand description
Handle to a running agent session for bidirectional communication.
Provides channels for:
- Sending user prompts to the agent (
sender) - Receiving events from the agent (
receiver) - Sending raw protocol messages like control responses (
stdin_tx) - Killing the agent process (
kill_tx)
The handle is returned by Agent::spawn and remains valid until the
agent process exits or is killed.
Fields§
§sender: Sender<String>Send user messages to the agent.
receiver: Receiver<AgentEvent>Receive events from the agent.
kill_tx: Option<Sender<()>>Kill the agent process.
session_id: Option<String>Session ID (set after SessionInit event).
stdin_tx: Sender<String>Send raw JSON lines to the agent’s stdin (for control responses).
Auto Trait Implementations§
impl Freeze for AgentHandle
impl !RefUnwindSafe for AgentHandle
impl Send for AgentHandle
impl Sync for AgentHandle
impl Unpin for AgentHandle
impl UnsafeUnpin for AgentHandle
impl !UnwindSafe for AgentHandle
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