pub struct Protocol {
pub name: String,
pub schema_theory: String,
pub instance_theory: String,
pub edge_rules: Vec<EdgeRule>,
pub obj_kinds: Vec<String>,
pub constraint_sorts: Vec<String>,
}Expand description
Identifies the schema and instance theories for a data-format protocol, together with structural well-formedness rules.
Protocols are the Level-1 configuration objects that drive schema
construction and validation. Each protocol names a schema theory GAT
and an instance theory GAT (both defined in panproto-protocols),
and supplies edge rules, recognized vertex kinds, and constraint sorts.
Fields§
§name: StringHuman-readable protocol name (e.g., "atproto", "sql").
schema_theory: StringName of the schema theory GAT in the theory registry.
instance_theory: StringName of the instance theory GAT in the theory registry.
edge_rules: Vec<EdgeRule>Well-formedness rules for each edge kind.
obj_kinds: Vec<String>Vertex kinds that are considered “object-like” (containers).
constraint_sorts: Vec<String>Recognized constraint sorts (e.g., "maxLength", "format").
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn find_edge_rule(&self, edge_kind: &str) -> Option<&EdgeRule>
pub fn find_edge_rule(&self, edge_kind: &str) -> Option<&EdgeRule>
Returns the EdgeRule for the given edge kind, if one exists.
Sourcepub fn is_known_vertex_kind(&self, kind: &str) -> bool
pub fn is_known_vertex_kind(&self, kind: &str) -> bool
Returns true if kind is a recognized vertex kind in this protocol.
The set of recognized kinds is the union of all kinds mentioned in
edge rules (both source and target) plus obj_kinds.