Skip to main content

Store

Struct Store 

Source
pub struct Store {
    pub root: PathBuf,
}

Fields§

§root: PathBuf

Implementations§

Source§

impl Store

Source

pub fn at(repo: &Path) -> Store

Source

pub fn ticks_dir(&self) -> PathBuf

Source

pub fn head_path(&self) -> PathBuf

Source

pub fn config_path(&self) -> PathBuf

Source

pub fn exists(&self) -> bool

Source

pub fn init(&self) -> Result<bool>

Create the layout. Returns Ok(true) if created, Ok(false) if it already existed (idempotent).

Source

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.

Source

pub fn read_head(&self) -> Result<String>

The current HEAD id (“” if genesis / empty store).

Source

pub fn read_tick(&self, id: &str) -> Result<Option<Tick>>

Read one tick (parsed) by id, or None if absent.

Source

pub fn read_all(&self) -> Result<Vec<(String, Value)>>

Read every tick file as (filename, raw JSON Value). Order is unspecified.

Source

pub fn read_origin_sha(&self) -> Option<String>

The cached live-origin sha (results/origin-sha), or None if absent/empty. No network.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.