pub struct Settings {Show 13 fields
pub relations: RelationSet,
pub link_style: LinkStyle,
pub id_links: bool,
pub reference_style: Option<ReferenceStyle>,
pub default_embed_format: Format,
pub embed_style: EmbedStyle,
pub fixity: Fixity,
pub record_deletions: bool,
pub id_storage: IdStorage,
pub workspace_id: String,
pub out_of_scope: Vec<PathBuf>,
pub root: Option<PathBuf>,
pub updated: String,
}Expand description
The workspace’s policy knobs, as one value.
Every field here answers “how does this workspace author and read
documents?” — the vocabulary, the reference style, where ids live, how far
checksums go. What is not here is as deliberate: the filesystem and root
are a location rather than a policy; and the identity policy and index store
are type parameters, because Workspace’s whole “identity is a bolt-on”
design is that they can be compiled out.
It exists as a struct because it was previously ten loose fields, and every
one of them had to be hand-copied through
identity, index,
build, and Workspace’s Clone — four lists
that had to agree, with nothing but review to make them. Carried whole,
those four sites stop mentioning the knobs at all, so adding one is a field
and its accessor rather than a field and four transcriptions.
Default is the paths-only workspace Workspace::builder starts from.
Note id_storage defaults to IdStorage::Registry rather than
WorkspaceConfig’s both: a hand-built
workspace keeps writing id-free documents until it opts in, where one built
from a config gets what the config declares — that is what the
From<&WorkspaceConfig> impl below is for.
Fields§
§relations: RelationSetThe relation vocabulary — see Workspace::relations.
link_style: LinkStyleThe path style links are authored in — see Workspace::link_style.
id_links: boolThe legacy “author links by id” axis, superseded by an explicit
reference_style — see Workspace::reference_style.
reference_style: Option<ReferenceStyle>The workspace-default reference style, overriding the link_style /
id_links pair when set — see Workspace::reference_style.
default_embed_format: FormatThe metadata format a new document gets when it inherits no parent block
— see Workspace::default_embed_format.
embed_style: EmbedStyleHow that metadata is embedded — see Workspace::embed_style.
fixity: FixityHow far content checksums are recorded — see Workspace::fixity.
record_deletions: boolWhether a delete records what it destroyed in the deletion log — see
Workspace::record_deletions.
id_storage: IdStorageWhere a document’s stable id is persisted — see
Workspace::id_storage.
workspace_id: StringWhat this workspace calls itself — the qualifier a cross-workspace
reference names it by. Empty means anonymous, so no id:<ws>/<id>
reference can ever be recognized as pointing back here. See
WorkspaceConfig::workspace_id.
out_of_scope: Vec<PathBuf>The directories the workspace declares are not its content — see
parked_dirs and
WorkspaceConfig::out_of_scope.
Workspace-relative, /-separated. Empty declares nothing.
root: Option<PathBuf>The document the workspace node names as the root, if it names one — see
WorkspaceConfig::root and
root_document. A bare file name in the root
directory. None means the root is chosen by the candidate scan.
updated: StringThe frontmatter field prov stamps when a document’s content changes —
see Workspace::updated_field. Empty means the workspace keeps no
such field.
Trait Implementations§
Source§impl From<&WorkspaceConfig> for Settings
The settings a WorkspaceConfig declares — the whole of what a workspace
says about itself in its own config document, in the form the builder takes.
impl From<&WorkspaceConfig> for Settings
The settings a WorkspaceConfig declares — the whole of what a workspace
says about itself in its own config document, in the form the builder takes.
This is the conversion the CLI used to spell out as ten builder calls. It
lives here rather than in config because workspace
already depends on config (for Fixity, IdStorage) and
the reverse edge would be a cycle for no gain.
Two fields are deliberately not read. identity is a
Registration, which the caller turns into
a policy type (Minter::with(config.identity, seed)) — it cannot be a
setting without giving up the bolt-on design. And id_links stays at its
default, because a config always yields an explicit reference_style, which
supersedes that legacy axis entirely.