pub struct SideHandle { /* private fields */ }Expand description
A read-only view of an Agent the actor can mine *while a run holds the
agent’s &mut. It carries the same clones the run uses (stream_fn/
system/llm) plus the context snapshot run_loop republishes each turn,
so a mid-run GetHistory/SideAsk is answered from the latest completed
turns instead of waiting for the whole run to finish.
Implementations§
Source§impl SideHandle
impl SideHandle
Sourcepub fn history(&self) -> Vec<AgentMessage>
pub fn history(&self) -> Vec<AgentMessage>
The latest turn-boundary context snapshot, owned (send_replace keeps
the value even with no receivers, so a read after the run still sees it).
Sourcepub fn last_assistant_text(&self) -> Option<String>
pub fn last_assistant_text(&self) -> Option<String>
The latest snapshot’s last-assistant text — a compact status read
(crate::protocol::Request::Status) that borrows the watch value instead
of cloning the whole transcript.
Sourcepub async fn side_ask(&self, text: &str) -> Result<SideAnswer, LoopError>
pub async fn side_ask(&self, text: &str) -> Result<SideAnswer, LoopError>
Answer text tool-free from the latest snapshot; semantics match
Agent::side_ask.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SideHandle
impl !UnwindSafe for SideHandle
impl Freeze for SideHandle
impl Send for SideHandle
impl Sync for SideHandle
impl Unpin for SideHandle
impl UnsafeUnpin for SideHandle
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