pub struct Store {
pub root: PathBuf,
}Fields§
§root: PathBufImplementations§
Source§impl Store
impl Store
pub fn at(repo: &Path) -> Store
pub fn ticks_dir(&self) -> PathBuf
pub fn head_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
pub fn exists(&self) -> bool
Sourcepub fn init(&self) -> Result<bool>
pub fn init(&self) -> Result<bool>
Create the layout. Returns Ok(true) if created, Ok(false) if it already existed (idempotent).
Sourcepub fn write_tick(&self, t: &Tick) -> Result<()>
pub fn write_tick(&self, t: &Tick) -> Result<()>
Write a tick file (pretty JSON; the id is recomputed on verify, not from these bytes) and advance HEAD.
Sourcepub fn read_tick(&self, id: &str) -> Result<Option<Tick>>
pub fn read_tick(&self, id: &str) -> Result<Option<Tick>>
Read one tick (parsed) by id, or None if absent.
Sourcepub fn read_all(&self) -> Result<Vec<(String, Value)>>
pub fn read_all(&self) -> Result<Vec<(String, Value)>>
Read every tick file as (filename, raw JSON Value). Order is unspecified.
Sourcepub fn read_origin_sha(&self) -> Option<String>
pub fn read_origin_sha(&self) -> Option<String>
The cached live-origin sha (results/origin-sha), or None if absent/empty. No network.
Sourcepub fn write_origin_sha(&self, sha: &str) -> Result<()>
pub fn write_origin_sha(&self, sha: &str) -> Result<()>
Cache the live-origin sha to results/origin-sha (the staleness reference for offline runs).
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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