pub struct SessionStore { /* private fields */ }Expand description
Shared SQLite-backed session store.
Implementations§
Source§impl SessionStore
impl SessionStore
Sourcepub async fn connect(path: &Path) -> Result<Self>
pub async fn connect(path: &Path) -> Result<Self>
Open the SQLite database, creating it and applying migrations if needed.
Sourcepub async fn insert_session_start(&self, info: &SessionInfo) -> Result<()>
pub async fn insert_session_start(&self, info: &SessionInfo) -> Result<()>
Persist the start of a session.
Sourcepub async fn insert_log_line(
&self,
session_id: &str,
entry: &LogEntry,
) -> Result<()>
pub async fn insert_log_line( &self, session_id: &str, entry: &LogEntry, ) -> Result<()>
Persist a log line for a session.
Sourcepub async fn insert_diagnostic(
&self,
session_id: &str,
diagnostic: &DiagnosticRecord,
) -> Result<()>
pub async fn insert_diagnostic( &self, session_id: &str, diagnostic: &DiagnosticRecord, ) -> Result<()>
Persist a structured diagnostic.
Sourcepub async fn insert_artifact(
&self,
session_id: &str,
artifact: &ArtifactRecord,
) -> Result<()>
pub async fn insert_artifact( &self, session_id: &str, artifact: &ArtifactRecord, ) -> Result<()>
Persist a built artifact in explicit sequence order.
Sourcepub async fn finish_session(&self, finish: &SessionFinished) -> Result<()>
pub async fn finish_session(&self, finish: &SessionFinished) -> Result<()>
Persist session completion data.
Sourcepub async fn upsert_detected_process(
&self,
process: &DetectedProcess,
) -> Result<()>
pub async fn upsert_detected_process( &self, process: &DetectedProcess, ) -> Result<()>
Upsert a passively detected external process snapshot.
Sourcepub async fn mark_process_gone(
&self,
session_id: &str,
observed_at: OffsetDateTime,
) -> Result<()>
pub async fn mark_process_gone( &self, session_id: &str, observed_at: OffsetDateTime, ) -> Result<()>
Mark a previously detected process as gone.
Sourcepub async fn recent_sessions(
&self,
limit: usize,
) -> Result<Vec<SessionHistoryEntry>>
pub async fn recent_sessions( &self, limit: usize, ) -> Result<Vec<SessionHistoryEntry>>
List the most recent sessions for the history view.
Sourcepub async fn load_session(
&self,
session_id: &str,
max_logs: usize,
) -> Result<Option<SessionState>>
pub async fn load_session( &self, session_id: &str, max_logs: usize, ) -> Result<Option<SessionState>>
Load a full session including persisted logs and diagnostics.
Sourcepub async fn cleanup_old_sessions(&self, retention_days: u32) -> Result<u64>
pub async fn cleanup_old_sessions(&self, retention_days: u32) -> Result<u64>
Delete sessions older than the configured retention window.
Trait Implementations§
Source§impl Clone for SessionStore
impl Clone for SessionStore
Source§fn clone(&self) -> SessionStore
fn clone(&self) -> SessionStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionStore
impl !RefUnwindSafe for SessionStore
impl Send for SessionStore
impl Sync for SessionStore
impl Unpin for SessionStore
impl UnsafeUnpin for SessionStore
impl !UnwindSafe for SessionStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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