pub struct SessionManager;Expand description
Session manager handles session CRUD and cleanup
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub async fn new() -> MinoResult<Self>
pub async fn new() -> MinoResult<Self>
Create a new session manager
Sourcepub async fn create(&self, session: &Session) -> MinoResult<()>
pub async fn create(&self, session: &Session) -> MinoResult<()>
Create a new session (atomic — fails if name already taken)
Sourcepub async fn list(&self) -> MinoResult<Vec<Session>>
pub async fn list(&self) -> MinoResult<Vec<Session>>
List all sessions
Sourcepub async fn update_status(
&self,
name: &str,
status: SessionStatus,
) -> MinoResult<()>
pub async fn update_status( &self, name: &str, status: SessionStatus, ) -> MinoResult<()>
Update session status
Sourcepub async fn set_container_id(
&self,
name: &str,
container_id: &str,
) -> MinoResult<()>
pub async fn set_container_id( &self, name: &str, container_id: &str, ) -> MinoResult<()>
Set container ID for a session
Sourcepub async fn delete(&self, name: &str) -> MinoResult<()>
pub async fn delete(&self, name: &str) -> MinoResult<()>
Delete a session
Sourcepub async fn find_by_container(
&self,
container_id: &str,
) -> MinoResult<Option<Session>>
pub async fn find_by_container( &self, container_id: &str, ) -> MinoResult<Option<Session>>
Find session by container ID
Sourcepub async fn cleanup(&self, max_age_hours: u32) -> MinoResult<u32>
pub async fn cleanup(&self, max_age_hours: u32) -> MinoResult<u32>
Remove stopped/failed sessions older than max_age_hours.
Returns the number of sessions cleaned up.
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