Skip to main content

Settings

Struct Settings 

Source
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: RelationSet

The relation vocabulary — see Workspace::relations.

§link_style: LinkStyle

The path style links are authored in — see Workspace::link_style.

§id_links: bool

The 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: Format

The metadata format a new document gets when it inherits no parent block — see Workspace::default_embed_format.

§embed_style: EmbedStyle

How that metadata is embedded — see Workspace::embed_style.

§fixity: Fixity

How far content checksums are recorded — see Workspace::fixity.

§record_deletions: bool

Whether a delete records what it destroyed in the deletion log — see Workspace::record_deletions.

§id_storage: IdStorage

Where a document’s stable id is persisted — see Workspace::id_storage.

§workspace_id: String

What 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: String

The 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 Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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.

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.

Source§

fn from(config: &WorkspaceConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.