pub trait Store {
type H: Harness;
type Ref;
// Required methods
fn discover(&self) -> Result<Vec<Discovered<Self::Ref>>>;
fn load(&self, reference: &Self::Ref) -> Result<Transcript<Self::H>>;
fn save(&self, transcript: &Transcript<Self::H>) -> Result<Saved<Self::Ref>>;
fn delete(&self, reference: &Self::Ref) -> Result<()>;
// Provided method
fn fingerprints(
&self,
_refs: &[Self::Ref],
) -> Result<HashMap<String, String>> { ... }
}Expand description
Reading and writing native transcripts against a real backend (a session
directory, a SQLite database, an import subprocess).
Required Associated Types§
Required Methods§
Sourcefn discover(&self) -> Result<Vec<Discovered<Self::Ref>>>
fn discover(&self) -> Result<Vec<Discovered<Self::Ref>>>
Cheap metadata scan — no full message parsing.
§Errors
When the backend itself fails; a missing root is Ok(vec![]).
Sourcefn load(&self, reference: &Self::Ref) -> Result<Transcript<Self::H>>
fn load(&self, reference: &Self::Ref) -> Result<Transcript<Self::H>>
Load and parse one transcript into its faithful native representation.
§Errors
When the reference doesn’t exist or its content doesn’t parse.
Sourcefn save(&self, transcript: &Transcript<Self::H>) -> Result<Saved<Self::Ref>>
fn save(&self, transcript: &Transcript<Self::H>) -> Result<Saved<Self::Ref>>
Persist a native transcript so the harness can resume it.
§Errors
When the backend rejects the write.
Sourcefn delete(&self, reference: &Self::Ref) -> Result<()>
fn delete(&self, reference: &Self::Ref) -> Result<()>
Remove one transcript from the backend so the harness no longer lists
or resumes it. File-backed stores remove the session file or directory;
OpenCode archives the session in place.
§Errors
When the reference doesn’t exist or the backend rejects the removal.
Provided Methods§
Sourcefn fingerprints(&self, _refs: &[Self::Ref]) -> Result<HashMap<String, String>>
fn fingerprints(&self, _refs: &[Self::Ref]) -> Result<HashMap<String, String>>
Per-reference change cursors, for callers that cache parsed transcripts.
Default: no fingerprints, forcing a re-parse. Backends with a cheap
change signal (file mtime, a MAX(updated) query) should override.
§Errors
When the backend itself fails; per-reference failures are empty strings.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl Store for AntigravityStore
Available on crate feature opencode only.
impl Store for AntigravityStore
opencode only.Source§impl Store for ClaudeChatStore
impl Store for ClaudeChatStore
type H = ClaudeChat
type Ref = ClaudeChatRef
Source§impl Store for CursorDesktopStore
Available on crate feature opencode only.
impl Store for CursorDesktopStore
opencode only.Source§impl Store for CursorStore
Available on crate feature opencode only.
impl Store for CursorStore
opencode only.Source§impl Store for HermesStore
Available on crate feature hermes only.
impl Store for HermesStore
hermes only.