pub struct SessionManager { /* private fields */ }Implementations§
Source§impl SessionManager
impl SessionManager
pub fn new(persistence: Arc<dyn Persistence>) -> Self
pub fn in_memory() -> Self
pub fn backend_name(&self) -> &str
pub async fn create(&self, config: SessionConfig) -> SessionResult<Session>
pub async fn create_with_tenant( &self, config: SessionConfig, tenant_id: impl Into<String>, ) -> SessionResult<Session>
pub async fn get(&self, id: &SessionId) -> SessionResult<Session>
pub async fn get_by_str(&self, id: &str) -> SessionResult<Session>
pub async fn update(&self, session: &Session) -> SessionResult<()>
pub async fn add_message( &self, session_id: &SessionId, message: SessionMessage, ) -> SessionResult<()>
pub async fn delete(&self, id: &SessionId) -> SessionResult<bool>
pub async fn list(&self) -> SessionResult<Vec<SessionId>>
pub async fn list_for_tenant( &self, tenant_id: &str, ) -> SessionResult<Vec<SessionId>>
pub async fn fork(&self, id: &SessionId) -> SessionResult<Session>
pub async fn complete(&self, id: &SessionId) -> SessionResult<()>
pub async fn set_error(&self, id: &SessionId) -> SessionResult<()>
pub async fn cleanup_expired(&self) -> SessionResult<usize>
pub async fn exists(&self, id: &SessionId) -> SessionResult<bool>
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 !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> 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 moreCreates a shared type from an unshared type.