pub struct SessionManager { /* private fields */ }Expand description
Global session manager.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn get_or_create_main(&mut self, agent_id: &str) -> &Session
pub fn get_or_create_main(&mut self, agent_id: &str) -> &Session
Create or get a main session.
Sourcepub fn spawn_subagent(
&mut self,
agent_id: &str,
task: &str,
label: Option<String>,
parent_key: Option<SessionKey>,
) -> SessionKey
pub fn spawn_subagent( &mut self, agent_id: &str, task: &str, label: Option<String>, parent_key: Option<SessionKey>, ) -> SessionKey
Spawn a sub-agent session.
Sourcepub fn get_by_label(&self, label: &str) -> Option<&Session>
pub fn get_by_label(&self, label: &str) -> Option<&Session>
Get a session by label.
Sourcepub fn list(
&self,
kinds: Option<&[SessionKind]>,
active_only: bool,
limit: usize,
) -> Vec<&Session>
pub fn list( &self, kinds: Option<&[SessionKind]>, active_only: bool, limit: usize, ) -> Vec<&Session>
List sessions with optional filters.
Sourcepub fn history(
&self,
key: &str,
limit: usize,
include_tools: bool,
) -> Option<Vec<&SessionMessage>>
pub fn history( &self, key: &str, limit: usize, include_tools: bool, ) -> Option<Vec<&SessionMessage>>
Get message history for a session.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl UnwindSafe for SessionManager
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