pub struct SessionManager { /* private fields */ }
Expand description
Advanced Session Manager with cross-platform support
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(config: SessionManagerConfig) -> Self
pub fn new(config: SessionManagerConfig) -> Self
Create a new session manager
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the session manager
Sourcepub async fn store_session(&self, session: Session) -> Result<Uuid>
pub async fn store_session(&self, session: Session) -> Result<Uuid>
Store a session with advanced metadata
Sourcepub async fn get_session(&self, session_id: Uuid) -> Result<Option<SessionData>>
pub async fn get_session(&self, session_id: Uuid) -> Result<Option<SessionData>>
Retrieve a session by ID
Sourcepub async fn update_session(
&self,
session_id: Uuid,
updated_session: Session,
) -> Result<()>
pub async fn update_session( &self, session_id: Uuid, updated_session: Session, ) -> Result<()>
Update a session
Sourcepub async fn remove_session(
&self,
session_id: Uuid,
reason: String,
) -> Result<()>
pub async fn remove_session( &self, session_id: Uuid, reason: String, ) -> Result<()>
Remove a session
Sourcepub async fn list_sessions(&self) -> Result<Vec<SessionData>>
pub async fn list_sessions(&self) -> Result<Vec<SessionData>>
List all active sessions
Sourcepub fn on_session_event<F>(&self, callback: F) -> Uuid
pub fn on_session_event<F>(&self, callback: F) -> Uuid
Add session event listener
Sourcepub fn remove_event_listener(&self, listener_id: Uuid)
pub fn remove_event_listener(&self, listener_id: Uuid)
Remove session event listener
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more