Skip to main content

Crate loftspec_store

Crate loftspec_store 

Source
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_EPOCH when 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 by recover, 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-driver in the repository that holds the tree (RQ-152, RQ-153): the attribute that routes spec/ files to the driver, beside spec/, and the driver’s command and name in the repository’s local configuration, each written only when it differs. The command that starts loft is the project’s to give, such as npx --no-install loft for 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 git command (the accepted decision “Git is an external component reached through the git command”). Nothing else in this crate runs git.

Structs§

Saved
The files of the spec/ tree a save wrote and removed.

Enums§

StoreError

Traits§

DocumentStore
Where a document is held between commands.