pub struct VaultScope<'a> {
pub project: Option<&'a str>,
pub members: &'a BTreeSet<String>,
}Expand description
Which vault a note is being rendered into: a single project’s, or one member of a workspace vault spanning several repositories.
This is the whole of the workspace-vault naming rule, in one place. Node keys
are repository-relative (file:README.md names no repo), so every member
of a workspace produces the same note name for its README.md and one would
silently overwrite the rest. Qualifying the key with its project fixes that.
VaultScope::PROJECT (project: None) is not a degenerate case but the
contract: it makes every name in this module reduce to exactly note_name
of the bare key, with nothing qualified and no project: frontmatter.
That reduction is still the promise; what it no longer implies is stability
against main. #570 could say “a single-project vault’s names do not move”,
because the only thing moving them would have been workspace qualification.
#574 moves them all, on purpose: the old names were not injective under
filename case folding and the vault lost 104 notes to that. The promise here
was always about this axis — turning workspace mode on must not rename a
project’s notes — and it holds unchanged. See note_name for the rename and
what it bought.
Fields§
§project: Option<&'a str>The member project this note belongs to, qualifying its name as
<project>::<key> — the same form ADR-0009’s cross-repo links already use.
None ⇒ a single-project vault, and names are unqualified exactly as
before.
members: &'a BTreeSet<String>The workspace’s member project names. An external-ref placeholder whose target names one of these is a cross-repo edge the vault can actually follow, so it is rendered as a link straight to that member’s note. Empty for a single-project vault.
Implementations§
Source§impl VaultScope<'_>
impl VaultScope<'_>
Source§impl VaultScope<'_>
impl VaultScope<'_>
Sourcepub fn redirects_external_ref(&self, key: &str) -> bool
pub fn redirects_external_ref(&self, key: &str) -> bool
Whether an external-ref placeholder key is one this vault resolves for
itself — its target names a member, so every edge to it points at the real
note and the placeholder need not be rendered at all.
The single rule behind both halves of that: [link_target] redirects
exactly the keys this accepts, and the caller skips writing exactly the
notes this accepts. They cannot disagree.
Trait Implementations§
Source§impl<'a> Clone for VaultScope<'a>
impl<'a> Clone for VaultScope<'a>
Source§fn clone(&self) -> VaultScope<'a>
fn clone(&self) -> VaultScope<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more