pub struct SqliteSessionStore { /* private fields */ }Expand description
Durable SQLite session store implementing SessionStore.
One dedicated blocking worker owns the synchronous connection. Async callers
exchange typed commands with that worker and never execute rusqlite on a
runtime worker thread.
Implementations§
Source§impl SqliteSessionStore
impl SqliteSessionStore
Sourcepub fn open(path: &str) -> Result<Self, SqliteSessionError>
pub fn open(path: &str) -> Result<Self, SqliteSessionError>
Opens or creates a store at the supplied SQLite path. Use :memory: for
an ephemeral database.
§Errors
Returns an error when the database cannot be opened, initialized, or validated.
Sourcepub fn in_memory() -> Result<Self, SqliteSessionError>
pub fn in_memory() -> Result<Self, SqliteSessionError>
Creates an in-memory store (single connection, process-local).
§Errors
Returns an error when the database cannot be created or validated.
Sourcepub const fn schema_version(&self) -> u32
pub const fn schema_version(&self) -> u32
Returns the installed schema version.
Trait Implementations§
Source§impl Debug for SqliteSessionStore
impl Debug for SqliteSessionStore
Source§impl Drop for SqliteSessionStore
impl Drop for SqliteSessionStore
Source§impl SessionCatalog for SqliteSessionStore
impl SessionCatalog for SqliteSessionStore
Source§fn list_sessions(&self) -> SessionStoreFuture<'_, Vec<SessionCatalogEntry>>
fn list_sessions(&self) -> SessionStoreFuture<'_, Vec<SessionCatalogEntry>>
Lists sessions ordered by latest durable timestamp descending, then ID.
Source§fn set_session_name(
&self,
session_id: SessionId,
name: Option<SessionName>,
) -> SessionStoreFuture<'_, ()>
fn set_session_name( &self, session_id: SessionId, name: Option<SessionName>, ) -> SessionStoreFuture<'_, ()>
Sets or clears one optional display name.
Source§fn session_name(
&self,
session_id: SessionId,
) -> SessionStoreFuture<'_, Option<SessionName>>
fn session_name( &self, session_id: SessionId, ) -> SessionStoreFuture<'_, Option<SessionName>>
Returns one optional display name.
Source§impl SessionStore for SqliteSessionStore
impl SessionStore for SqliteSessionStore
Source§fn load(&self, session_id: SessionId) -> SessionStoreFuture<'_, SessionSnapshot>
fn load(&self, session_id: SessionId) -> SessionStoreFuture<'_, SessionSnapshot>
Loads one immutable session snapshot.
Source§fn append(
&self,
transaction: AppendTransaction,
) -> SessionStoreFuture<'_, AppendOutcome>
fn append( &self, transaction: AppendTransaction, ) -> SessionStoreFuture<'_, AppendOutcome>
Atomically validates and appends one transaction.
Source§fn active_grants_for_actor(
&self,
actor_id: ActorId,
) -> SessionStoreFuture<'_, Vec<PolicyGrant>>
fn active_grants_for_actor( &self, actor_id: ActorId, ) -> SessionStoreFuture<'_, Vec<PolicyGrant>>
Returns non-revoked grant candidates issued to one actor across sessions.
Auto Trait Implementations§
impl !Freeze for SqliteSessionStore
impl RefUnwindSafe for SqliteSessionStore
impl Send for SqliteSessionStore
impl Sync for SqliteSessionStore
impl Unpin for SqliteSessionStore
impl UnsafeUnpin for SqliteSessionStore
impl UnwindSafe for SqliteSessionStore
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