pub struct SessionManager { /* private fields */ }Expand description
Manager for active sessions
Provides thread-safe session storage and lookup using DashMap. Uses entry API for atomic operations to prevent deadlocks.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn create_session(
&self,
session_id: String,
cwd: PathBuf,
config: &AgentConfig,
meta: Option<&NewSessionMeta>,
) -> Result<Arc<Session>>
pub fn create_session( &self, session_id: String, cwd: PathBuf, config: &AgentConfig, meta: Option<&NewSessionMeta>, ) -> Result<Arc<Session>>
Sourcepub fn get_session_or_error(&self, session_id: &str) -> Result<Arc<Session>>
pub fn get_session_or_error(&self, session_id: &str) -> Result<Arc<Session>>
Get an existing session or return SessionNotFound error
Sourcepub fn has_session(&self, session_id: &str) -> bool
pub fn has_session(&self, session_id: &str) -> bool
Check if a session exists
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Get the number of active sessions
Sourcepub fn session_ids(&self) -> Vec<String>
pub fn session_ids(&self) -> Vec<String>
Get all session IDs
Trait Implementations§
Source§impl Debug for SessionManager
impl Debug for SessionManager
Source§impl Default for SessionManager
impl Default for SessionManager
Source§fn default() -> SessionManager
fn default() -> SessionManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin 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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request