pub enum AnchorRole {
Invocation,
ValueSource,
Other(String),
}Expand description
Role describing what kind of source-side contribution an anchor records.
The known roles are load-bearing — Invocation is what the writer’s
preimage walk and attribution consult; ValueSource is diagnostic-only.
Other(String) is an open escape hatch for extension-defined roles.
Variants§
Invocation
The user-written construct that triggered this node’s creation
(e.g. the {{< meta foo >}} token in the active document).
Load-bearing: the writer’s preimage_in and attribution’s
resolve_byte_range consult the first anchor with this role.
At most one per node by convention.
ValueSource
Where the VALUE this node carries was defined, when distinct
from the invocation site (e.g. footer: in _metadata.yml for
a {{< meta footer >}} resolution). Diagnostic-only — does not
affect the writer or attribution decisions in v1.
Other(String)
Extension-defined or future role we haven’t enumerated.
String is kebab-case, namespaced (ext/<name>/<role>).
preimage_in does not walk this role. Future anchor roles
default to non-walked unless explicitly added to
SourceInfo::preimage_in’s Generated arm. Extensions adding
Other("…") should treat this as a feature: attribution data
attached via Other is not accidentally consulted by the writer’s
byte-copying path. If a role does contribute to body-text
preimage in target, it must be explicitly enumerated in
preimage_in.
Trait Implementations§
Source§impl Clone for AnchorRole
impl Clone for AnchorRole
Source§fn clone(&self) -> AnchorRole
fn clone(&self) -> AnchorRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnchorRole
impl Debug for AnchorRole
Source§impl<'de> Deserialize<'de> for AnchorRole
impl<'de> Deserialize<'de> for AnchorRole
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AnchorRole
impl PartialEq for AnchorRole
Source§fn eq(&self, other: &AnchorRole) -> bool
fn eq(&self, other: &AnchorRole) -> bool
self and other values to be equal, and is used by ==.