pub enum EdgeRelation {
Show 20 variants
Contains,
PartOf,
InstanceOf,
LinksTo,
LocatedIn,
Extends,
VariantOf,
IntroducedBy,
Supersedes,
DerivedFrom,
Precedes,
DependsOn,
Enables,
Implements,
CompetesWith,
ComposedWith,
Annotates,
Supports,
Refutes,
Owns,
}Expand description
Closed set of 20 canonical edge relations.
No Default — every edge requires an explicit relation.
Wire format: snake_case strings (e.g. "part_of", "introduced_by").
Variants§
Contains
PartOf
InstanceOf
LinksTo
LocatedIn
Extends
VariantOf
IntroducedBy
Supersedes
DerivedFrom
Precedes
DependsOn
Enables
Implements
CompetesWith
ComposedWith
Annotates
Supports
Refutes
Owns
Implementations§
Source§impl EdgeRelation
impl EdgeRelation
Sourcepub const VALID_NAMES: &'static [&'static str]
pub const VALID_NAMES: &'static [&'static str]
Valid snake_case names for all 20 canonical relations.
Sourcepub const fn is_symmetric(&self) -> bool
pub const fn is_symmetric(&self) -> bool
true for symmetric relations: edge direction has no semantic meaning.
Sourcepub fn canonical_endpoints<T: Ord>(&self, source: T, target: T) -> (T, T)
pub fn canonical_endpoints<T: Ord>(&self, source: T, target: T) -> (T, T)
Order the endpoints of an edge so a symmetric relation has one stored form.
For symmetric relations (competes_with, composed_with) the smaller
endpoint comes first, so A→B and B→A collapse into a single canonical row.
Every other relation, and a symmetric pair that is already ordered or has
equal endpoints, is returned as given.
Generic over T: Ord because this crate does not depend on a UUID type;
for UUIDs the order is the byte order of the id.
Sourcepub const fn category(&self) -> EdgeCategory
pub const fn category(&self) -> EdgeCategory
The category this relation belongs to.
Trait Implementations§
Source§impl Clone for EdgeRelation
impl Clone for EdgeRelation
impl Copy for EdgeRelation
Source§impl Debug for EdgeRelation
impl Debug for EdgeRelation
Source§impl Display for EdgeRelation
impl Display for EdgeRelation
impl Eq for EdgeRelation
Source§impl FromStr for EdgeRelation
impl FromStr for EdgeRelation
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a string into an EdgeRelation.
Accepts the 20 canonical relation names (case-insensitive, with hyphens
normalised to underscores) and also squashed forms that omit the separator
(e.g. "partof", "derivedfrom"). The squashed forms exist for ergonomic
DSL entry; they are not stored on the wire, which always uses the
canonical snake_case form produced by EdgeRelation::as_str.