pub struct DirBackend { /* private fields */ }Expand description
Every script as plain files under one directory the host chooses:
<root>/<name>/head.json the head (compare-and-set on every write)
<root>/<name>/versions/<hex>.json one immutable version, named by its sha256
<root>/<name>/runs/<id>.json one run recordOne host process per directory, the rule ikigai-store states for RocksDB: writes
are serialized by a lock in this process, and a second process writing the same
directory would race it. People editing files by hand are expected and survivable; see
the module documentation.
Implementations§
Trait Implementations§
Source§impl Backend for DirBackend
impl Backend for DirBackend
Source§fn head(&self, name: &str) -> Result<Option<Head>>
fn head(&self, name: &str) -> Result<Option<Head>>
The head of
name, or None when no such script exists.Source§fn swap_head(
&self,
name: &str,
expected: Option<&Head>,
new: &Head,
) -> Result<()>
fn swap_head( &self, name: &str, expected: Option<&Head>, new: &Head, ) -> Result<()>
Replace the head of
name with new, if it is still expected (None: if no
head exists yet). Otherwise a typed Conflict: someone got there first.Source§fn put_version(&self, name: &str, version: &Version) -> Result<()>
fn put_version(&self, name: &str, version: &Version) -> Result<()>
Store a version under
name. Idempotent: a version is its content.Source§fn version(&self, name: &str, digest: &str) -> Result<Option<Version>>
fn version(&self, name: &str, digest: &str) -> Result<Option<Version>>
The version
digest of name, or None. An implementation verifies the content
against the digest and refuses a mismatch.Source§fn start_run(&self, name: &str, run: &Run) -> Result<u64>
fn start_run(&self, name: &str, run: &Run) -> Result<u64>
Record a run that is starting, under a fresh id (the
id field is ignored), and
return the id.Auto Trait Implementations§
impl !Freeze for DirBackend
impl RefUnwindSafe for DirBackend
impl Send for DirBackend
impl Sync for DirBackend
impl Unpin for DirBackend
impl UnsafeUnpin for DirBackend
impl UnwindSafe for DirBackend
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