pub struct ProvenanceStore { /* private fields */ }Expand description
Project-scoped JSONL persistence for edit provenance and checkpoints.
Implementations§
Source§impl ProvenanceStore
impl ProvenanceStore
Sourcepub fn new(project_hash: impl Into<String>) -> Result<Self, String>
pub fn new(project_hash: impl Into<String>) -> Result<Self, String>
Opens the default <data>/provenance/<project-hash>/provenance.jsonl store.
Sourcepub fn with_data_dir(
data_dir: impl AsRef<Path>,
project_hash: impl Into<String>,
) -> Result<Self, String>
pub fn with_data_dir( data_dir: impl AsRef<Path>, project_hash: impl Into<String>, ) -> Result<Self, String>
Opens a store below an explicit data directory, primarily for isolated callers and tests.
pub fn project_hash(&self) -> &str
pub fn storage_path(&self) -> &Path
Sourcepub fn record_file_touch(
&self,
record: ProvenanceRecord,
) -> Result<ProvenanceId, String>
pub fn record_file_touch( &self, record: ProvenanceRecord, ) -> Result<ProvenanceId, String>
Persists a file observation, returning an existing record ID for a duplicate operation.
pub fn record_checkpoint( &self, record: CheckpointRecord, ) -> Result<CheckpointId, String>
pub fn query_by_path(&self, path: &str) -> Vec<ProvenanceRecord>
pub fn query_by_session(&self, session_id: &str) -> Vec<ProvenanceRecord>
Sourcepub fn query_recent_file_touches(&self, limit: usize) -> Vec<ProvenanceRecord>
pub fn query_recent_file_touches(&self, limit: usize) -> Vec<ProvenanceRecord>
Returns the most recently observed file touches, newest first.
pub fn query_checkpoints( &self, session_id: Option<&str>, ) -> Vec<CheckpointRecord>
Trait Implementations§
Source§impl Clone for ProvenanceStore
impl Clone for ProvenanceStore
Auto Trait Implementations§
impl Forget for ProvenanceStore
impl Freeze for ProvenanceStore
impl Move for ProvenanceStore
impl RefUnwindSafe for ProvenanceStore
impl Send for ProvenanceStore
impl Sync for ProvenanceStore
impl Unpin for ProvenanceStore
impl UnsafeUnpin for ProvenanceStore
impl UnwindSafe for ProvenanceStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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