Expand description
Memory and file stores for Loft Specification Format documents: one interface that loads a
document, saves it and reports its roots, held in memory or as a spec/ tree, so the same
scenarios run against both and the two agree.
Re-exports§
pub use file::FileStore;pub use memory::MemoryStore;
Modules§
- clock
- The clock port: the time of a publish, in whole seconds since the Unix epoch, from
SOURCE_DATE_EPOCHwhen it is set and from the system clock otherwise. - file
- The file store: the document held as the
spec/tree under a directory, read through the codec and saved through the journal. - fs
- The paths of the Format on disk, and the outputs a command writes outside the tree.
- journal
- A save through a journal beside
spec/, the accepted decision “A save is journaled and finished by the next command”: the changed files are staged in.loft/save/, renaming the journal’s plan into place commits the save, and each staged file is then renamed into place. A save interrupted before the commit leaves every file as it was; one interrupted after is finished byrecover, which the file store runs when it is opened. - memory
- The memory store: the document held as the model, for tests and for a later server.
- merge_
driver - Registering
loft merge-driverin the repository that holds the tree (RQ-152, RQ-153): the attribute that routesspec/files to the driver, besidespec/, and the driver’s command and name in the repository’s local configuration, each written only when it differs. The command that startsloftis the project’s to give, such asnpx --no-install loftfor a dev dependency; the install first checks that git can run it. - repository
- The repository port: what the publisher needs to know of the git repository that holds the
tree, a merge or rebase stopped in it included, and the local configuration that registers
the merge driver, through the
gitcommand (the accepted decision “Git is an external component reached through thegitcommand”). Nothing else in this crate runs git.
Structs§
- Saved
- The files of the
spec/tree a save wrote and removed.
Enums§
Traits§
- Document
Store - Where a document is held between commands.