pub struct GitSessionStore { /* private fields */ }Expand description
Git-backed session store using a bare repo at ~/.pawan/repo/
Implementations§
Source§impl GitSessionStore
impl GitSessionStore
Sourcepub fn open(repo: Repository) -> Self
pub fn open(repo: Repository) -> Self
Open with a custom path (for testing)
Sourcepub fn save_commit(
&self,
session: &Session,
parent_hash: Option<&str>,
) -> Result<String>
pub fn save_commit( &self, session: &Session, parent_hash: Option<&str>, ) -> Result<String>
Save session as a git commit. Returns the commit hash.
Sourcepub fn load_commit(&self, hash: &str) -> Result<Session>
pub fn load_commit(&self, hash: &str) -> Result<Session>
Load session from a commit hash
Sourcepub fn fork(&self, parent_hash: &str, session: &Session) -> Result<String>
pub fn fork(&self, parent_hash: &str, session: &Session) -> Result<String>
Fork: create a new commit branching off parent
Sourcepub fn list_leaves(&self) -> Result<Vec<CommitInfo>>
pub fn list_leaves(&self) -> Result<Vec<CommitInfo>>
List leaf commits (conversation tips with no children)
Sourcepub fn list_sessions(&self) -> Result<Vec<CommitInfo>>
pub fn list_sessions(&self) -> Result<Vec<CommitInfo>>
List all session refs (latest commit per session)
Auto Trait Implementations§
impl Freeze for GitSessionStore
impl RefUnwindSafe for GitSessionStore
impl Send for GitSessionStore
impl !Sync for GitSessionStore
impl Unpin for GitSessionStore
impl UnsafeUnpin for GitSessionStore
impl UnwindSafe for GitSessionStore
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