pub struct Relation {
pub rel: String,
pub target_uri: String,
pub display_name: Option<String>,
}Expand description
A graph relation a frame participates in, surfaced with a human label —
raw ids are never the primary identifier (SPEC.md §G1).
Fields§
§rel: StringThe edge label. See rel for the recommended vocabulary; unknown
values are valid and MUST NOT be rejected by a host.
target_uri: String§display_name: Option<String>Implementations§
Source§impl Relation
impl Relation
Sourcepub fn has_display_name(&self) -> bool
pub fn has_display_name(&self) -> bool
Whether this edge can be surfaced to a human by name.
The “never a raw id” rule has been documented since the protocol’s first
draft and was checked by nothing; SPEC.md §G1 now makes it a
conformance requirement for graph-capable providers, and this is the
predicate behind it.
Sourcepub fn has_target_uri(&self) -> bool
pub fn has_target_uri(&self) -> bool
Whether this edge points somewhere (SPEC.md §G2).
target_uri is a required field, so serde guarantees it is present —
but "" deserializes happily, and an edge to nowhere is not an edge.
The schema has carried minLength: 1 here from the start; §G2 claimed
frame-validity verified it and no code did, which is the
self-attestation §11.1 exists to rule out.
Sourcepub fn uses_recommended_vocabulary(&self) -> bool
pub fn uses_recommended_vocabulary(&self) -> bool
Whether rel uses the recommended vocabulary. Advisory only — a false
here is a hint for a provider author, never a conformance failure.