pub struct DaemonSession {
pub turn_event_stats: Mutex<TurnEventStats>,
pub last_turn_end_state: Mutex<String>,
pub last_turn_cancel_seen: Mutex<bool>,
pub last_turn_error_message: Mutex<String>,
/* private fields */
}Expand description
Dual-socket session: stream + lazy RPC sidecar.
Fields§
§turn_event_stats: Mutex<TurnEventStats>Per-turn stream filtering counters.
last_turn_end_state: Mutex<String>Last turn end state label.
last_turn_cancel_seen: Mutex<bool>Whether cancel was observed for the last turn.
last_turn_error_message: Mutex<String>Last turn error message.
Implementations§
Source§impl DaemonSession
impl DaemonSession
Sourcepub fn new(
ws_url: impl Into<String>,
opts: Option<DaemonSessionOptions>,
) -> Self
pub fn new( ws_url: impl Into<String>, opts: Option<DaemonSessionOptions>, ) -> Self
Create a session for ws_url.
Sourcepub fn stream_client(&self) -> &Client
pub fn stream_client(&self) -> &Client
Stream socket.
Sourcepub fn rpc_client(&self) -> &Client
pub fn rpc_client(&self) -> &Client
RPC sidecar socket (lazy-connected for list/cards/history).
Sourcepub async fn connect(
&self,
resume_loop_id: Option<&str>,
) -> Result<Map<String, Value>>
pub async fn connect( &self, resume_loop_id: Option<&str>, ) -> Result<Map<String, Value>>
Connect and bootstrap a loop (or resume).
Sourcepub async fn new_loop(&self) -> Result<Map<String, Value>>
pub async fn new_loop(&self) -> Result<Map<String, Value>>
Start a fresh loop on the stream socket.
Sourcepub async fn switch_loop(&self, loop_id: &str) -> Result<Map<String, Value>>
pub async fn switch_loop(&self, loop_id: &str) -> Result<Map<String, Value>>
Switch to an existing loop.
Sourcepub async fn ensure_connected(&self) -> Result<()>
pub async fn ensure_connected(&self) -> Result<()>
Reconnect + reattach, or fresh bootstrap if stale.
Sourcepub async fn send_turn(
&self,
text: &str,
opts: Option<SendTurnOptions>,
) -> Result<()>
pub async fn send_turn( &self, text: &str, opts: Option<SendTurnOptions>, ) -> Result<()>
Send a user turn on the stream socket.
Sourcepub async fn cancel_active_turn(&self) -> Result<()>
pub async fn cancel_active_turn(&self) -> Result<()>
Cancel active turn via /cancel.
Sourcepub async fn list_loops(&self, limit: u32) -> Result<Map<String, Value>>
pub async fn list_loops(&self, limit: u32) -> Result<Map<String, Value>>
List loops via RPC sidecar.
Sourcepub async fn fetch_loop_cards(
&self,
loop_id: &str,
) -> Result<Map<String, Value>>
pub async fn fetch_loop_cards( &self, loop_id: &str, ) -> Result<Map<String, Value>>
Fetch cards via RPC sidecar.
Auto Trait Implementations§
impl !Freeze for DaemonSession
impl !RefUnwindSafe for DaemonSession
impl !UnwindSafe for DaemonSession
impl Send for DaemonSession
impl Sync for DaemonSession
impl Unpin for DaemonSession
impl UnsafeUnpin for DaemonSession
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