pub struct SessionManager { /* private fields */ }Implementations§
Source§impl SessionManager
impl SessionManager
pub async fn new() -> Result<Self>
pub async fn save(&self, id: Uuid, entries: &[SessionEntry]) -> Result<()>
pub async fn load(&self, id: Uuid) -> Result<Vec<SessionEntry>>
pub fn session_path(&self, id: &Uuid) -> PathBuf
Sourcepub async fn list_sessions(&self) -> Result<Vec<SessionMeta>>
pub async fn list_sessions(&self) -> Result<Vec<SessionMeta>>
List all session IDs
Sourcepub async fn save_meta(&self, meta: &SessionMeta) -> Result<()>
pub async fn save_meta(&self, meta: &SessionMeta) -> Result<()>
Save session metadata
Sourcepub async fn create(&self) -> Result<SessionMeta>
pub async fn create(&self) -> Result<SessionMeta>
Create a new session
Sourcepub async fn branch_from(
&self,
parent_id: Uuid,
entry_id: Uuid,
) -> Result<(Uuid, Vec<SessionEntry>)>
pub async fn branch_from( &self, parent_id: Uuid, entry_id: Uuid, ) -> Result<(Uuid, Vec<SessionEntry>)>
Create a branch from an existing session at a given entry
Sourcepub async fn get_entries(&self, session_id: Uuid) -> Result<Vec<SessionEntry>>
pub async fn get_entries(&self, session_id: Uuid) -> Result<Vec<SessionEntry>>
Get all entries in a session
Sourcepub async fn get_tree(
&self,
session_id: Uuid,
) -> Result<Vec<(Uuid, SessionEntry)>>
pub async fn get_tree( &self, session_id: Uuid, ) -> Result<Vec<(Uuid, SessionEntry)>>
Get all entries in tree order (depth-first traversal from root to this session)
Sourcepub async fn get_branches_from_entry(
&self,
entry_id: Uuid,
) -> Result<Vec<(Uuid, SessionEntry)>>
pub async fn get_branches_from_entry( &self, entry_id: Uuid, ) -> Result<Vec<(Uuid, SessionEntry)>>
Get all direct branches from a given entry across all sessions
Sourcepub async fn get_branch_info(
&self,
session_id: Uuid,
) -> Result<Option<BranchInfo>>
pub async fn get_branch_info( &self, session_id: Uuid, ) -> Result<Option<BranchInfo>>
Get branch point info for a session
Auto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin 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> 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