pub struct InMemorySessionStore { /* private fields */ }Expand description
In-memory session store using parking_lot::RwLock (not tokio — matches
codebase pattern for locks never held across .await; parking_lot is
adopted on the channel hot path for ~2× faster uncontended reads, see T2
in tasks/performance-audit-heartbit-core-2026-05-06.md).
Implementations§
Trait Implementations§
Source§impl Default for InMemorySessionStore
impl Default for InMemorySessionStore
Source§impl SessionStore for InMemorySessionStore
impl SessionStore for InMemorySessionStore
Source§fn create(&self, title: Option<String>) -> Result<Session, Error>
fn create(&self, title: Option<String>) -> Result<Session, Error>
Create a new session with an optional title.
Source§fn create_with_user(
&self,
title: Option<String>,
user_id: &str,
tenant_id: &str,
) -> Result<Session, Error>
fn create_with_user( &self, title: Option<String>, user_id: &str, tenant_id: &str, ) -> Result<Session, Error>
Create a session with user/tenant context for multi-tenant isolation.
Default: delegates to
create() and patches user/tenant fields.Source§fn get(&self, id: Uuid) -> Result<Option<Session>, Error>
fn get(&self, id: Uuid) -> Result<Option<Session>, Error>
Get a session by ID. Returns
None if not found.Source§fn delete(&self, id: Uuid) -> Result<bool, Error>
fn delete(&self, id: Uuid) -> Result<bool, Error>
Delete a session. Returns true if found and deleted.
Source§fn add_message(&self, id: Uuid, message: SessionMessage) -> Result<(), Error>
fn add_message(&self, id: Uuid, message: SessionMessage) -> Result<(), Error>
Append a message to an existing session.
Auto Trait Implementations§
impl !Freeze for InMemorySessionStore
impl !RefUnwindSafe for InMemorySessionStore
impl Send for InMemorySessionStore
impl Sync for InMemorySessionStore
impl Unpin for InMemorySessionStore
impl UnsafeUnpin for InMemorySessionStore
impl UnwindSafe for InMemorySessionStore
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