pub enum EdgeTarget {
Local(String),
Grounded {
ontology: String,
atom: ContentAddress,
},
}Expand description
The endpoint of a typed edge.
Most edges are LOCAL: a name resolved within the node’s OWN ontology, bound
by that ontology’s Merkle root (the form every .prx has carried so far). A
GROUNDED edge is the foreign-atom slot — it crosses INTO another ontology,
naming an atom by its content ContentAddress in a declared connected
ontology. It is the typed cross-ontology morphism the grounding vocabulary
rides (lexical denotes and the other kinds): a span endpoint resolved by
content-address agreement across archives, not by name within one.
§Byte-exactness
Local serializes byte-IDENTICALLY to the bare string target it replaced, so
every node minted before grounding existed keeps its exact content address —
the codec migration is invisible to all-local archives (the committed pins
re-verify unchanged). Grounded serializes as a CBOR map, which the decoder
tells apart from a string by major type (deserialize_any); the common local
case spends no discriminator byte.
Variants§
Local(String)
A same-ontology target, by name — resolved within the node’s ontology.
Grounded
A cross-ontology target: an atom of ontology named by its content
atom address (the foreign-atom slot; resolved by address agreement).
Fields
atom: ContentAddressThe content address of the foreign atom.
Implementations§
Source§impl EdgeTarget
impl EdgeTarget
Sourcepub fn local_name(&self) -> Option<&str>
pub fn local_name(&self) -> Option<&str>
The local target name, or None if this edge grounds into another
ontology. Traversers of the LOCAL graph use this; it forces the foreign
case to be handled explicitly, never silently read as a local name.
Trait Implementations§
Source§impl Clone for EdgeTarget
impl Clone for EdgeTarget
Source§fn clone(&self) -> EdgeTarget
fn clone(&self) -> EdgeTarget
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 EdgeTarget
impl Debug for EdgeTarget
Source§impl<'de> Deserialize<'de> for EdgeTarget
impl<'de> Deserialize<'de> for EdgeTarget
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for EdgeTarget
Source§impl From<&str> for EdgeTarget
impl From<&str> for EdgeTarget
Source§impl From<String> for EdgeTarget
impl From<String> for EdgeTarget
Source§impl Hash for EdgeTarget
impl Hash for EdgeTarget
Source§impl Ord for EdgeTarget
impl Ord for EdgeTarget
Source§fn cmp(&self, other: &EdgeTarget) -> Ordering
fn cmp(&self, other: &EdgeTarget) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for EdgeTarget
impl PartialEq for EdgeTarget
Source§fn eq(&self, other: &EdgeTarget) -> bool
fn eq(&self, other: &EdgeTarget) -> bool
self and other values to be equal, and is used by ==.