pub struct SessionDb { /* private fields */ }Expand description
An open SessionDb — either in-memory (fresh) or backed by a file.
Implementations§
Source§impl SessionDb
impl SessionDb
Sourcepub fn create(opts: CreateOptions<'_>) -> Result<Self>
pub fn create(opts: CreateOptions<'_>) -> Result<Self>
Create a fresh SessionDb. Applies DDL, stamps PRAGMA user_version,
inserts the session row, and records session-group metadata.
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open an existing SessionDb from disk. Refuses to open DBs with a
mismatched PRAGMA user_version: the caller must re-collect.
Sourcepub fn save_to(&self, path: &Path) -> Result<()>
pub fn save_to(&self, path: &Path) -> Result<()>
Copy the current in-memory (or on-disk) DB to path using the SQLite
online backup API. The source DB stays usable.
Sourcepub fn has_captured_data(&self) -> Result<bool>
pub fn has_captured_data(&self) -> Result<bool>
True iff the session has accumulated data worth keeping — either a breakpoint hit was captured (debug track) or a data layer landed (profile track). Used by the daemon shutdown path to decide whether to persist or discard an auto session.
Sourcepub fn promote_to_user(&self) -> Result<()>
pub fn promote_to_user(&self) -> Result<()>
Promote this session so prune will never delete it.
pub fn set_meta(&self, key: &str, value: &str) -> Result<()>
pub fn meta(&self, key: &str) -> Result<Option<String>>
pub fn conn(&self) -> &Connection
pub fn session_id(&self) -> &str
pub fn label(&self) -> &str
pub fn kind(&self) -> SessionKind
pub fn target_class(&self) -> TargetClass
pub fn target(&self) -> &str
pub fn db_path(&self) -> Option<&Path>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SessionDb
impl !RefUnwindSafe for SessionDb
impl Send for SessionDb
impl !Sync for SessionDb
impl Unpin for SessionDb
impl UnsafeUnpin for SessionDb
impl !UnwindSafe for SessionDb
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> 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