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, because
the rule has a hard compatibility half. 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 — but a single-project vault’s
note names must not move: Obsidian resolves [[links]] by name, and a
user’s own notes live outside the vault and link into it (issue #442), so a
rename breaks every such link silently, with no error and nothing to grep for.
Hence 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, byte for byte.
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