1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! # prov-graph
//!
//! The read core of a [prov](https://docs.rs/prov) workspace: plaintext
//! documents, the links declared in their own embedded metadata, and the
//! traversal over them.
//!
//! ## What this crate is for
//!
//! A prov workspace describes itself. Follow the links in a document's
//! frontmatter and body and the whole structure unfolds — no index to trust
//! instead of the documents, no sidecar folder that has to be kept in step.
//! This crate is that unfolding, and *only* that.
//!
//! Everything here reads. The filesystem port it asks for
//! ([`fs::ReadStorage`]) has no method that writes a byte; the id index it asks
//! for ([`index::IdIndex`]) has no method that changes a registration. Nor is
//! the vocabulary for writing merely unused — it is *absent*, declared a layer
//! up in `prov-store` instead. So a consumer that must not modify a workspace —
//! a language server, a static renderer, a browser viewer — can depend on this
//! crate and be *unable* to, rather than merely intending not to. That is the
//! whole reason the split exists, and it is why the write halves are not here
//! behind a feature flag someone could leave switched on.
//!
//! The write surface is `prov-store`: `Storage`, the metadata editor, and the
//! `IndexStore` registries. The verbs are `prov`: creating, renaming, deleting,
//! attaching, the change/journal machinery that makes a mutation crash-atomic,
//! the version history, the config layer, the validation and repair passes.
//! `prov` owns one [`Graph`] and forwards every read to it, so the two are the
//! same traversal — not a reimplementation that can drift.
//!
//! `prov-views` is what that promise looks like taken up: a whole view engine —
//! parse a declared view, resolve its scope by walking the spanning relation,
//! group the documents it reaches — built on this crate and nothing else, and
//! therefore unable to modify a byte of what it reads.
//!
//! ## The shape of it
//!
//! - [`Document`] — a plaintext file split into its embedded metadata block and
//! its body.
//! - [`relation::RelationSet`] — which metadata fields are links. Exactly one
//! may be **spanning**: the single-parent tree that gives a workspace its
//! discovery spine. Every other relation may be many-to-many, so the tree is a
//! backbone, never a ceiling.
//! - [`Graph`] — a root, a [`fs::ReadStorage`], an [`index::IdIndex`], and the
//! [`graph::ReadSettings`] that say how links are spelled. Its two walks are
//! the [`census`](Graph::census) (every forward link, flat, each tagged with
//! where it is written and how it resolves) and the [`tree`](Graph::tree)
//! (the spanning relation only, as a materialized outline).
//!
//! The census is ground truth. Reachability, the backlinks map, and prov's own
//! validation findings are all views over it, and any stored index heals
//! *toward* it, never the reverse.
// At least one embedded-metadata format backend must be compiled in, otherwise
// nothing here can parse a document at all. The format features (`yaml`,
// `json`, `toml`, `fig-lang`) forward to the matching `fig` parser.
compile_error!;
pub use ;
pub use ;
pub use ;
pub use block_on;
pub use ExtKind;
pub use Format;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ReadScope;
pub use ;
pub use ;
pub use ;
pub use ;