pub struct Protocol {Show 17 fields
pub name: String,
pub schema_theory: String,
pub instance_theory: String,
pub schema_composition: Option<CompositionSpec>,
pub instance_composition: Option<CompositionSpec>,
pub edge_rules: Vec<EdgeRule>,
pub obj_kinds: Vec<String>,
pub constraint_sorts: Vec<String>,
pub has_order: bool,
pub has_coproducts: bool,
pub has_recursion: bool,
pub has_causal: bool,
pub nominal_identity: bool,
pub has_defaults: bool,
pub has_coercions: bool,
pub has_mergers: bool,
pub has_policies: bool,
}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.
schema_composition: Option<CompositionSpec>Composition recipe that produced the schema theory.
instance_composition: Option<CompositionSpec>Composition recipe that produced the instance theory.
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").
has_order: boolWhether this protocol uses ordered collections (ThOrder).
has_coproducts: boolWhether this protocol has coproduct/union types (ThCoproduct).
has_recursion: boolWhether this protocol supports recursive types (ThRecursion).
has_causal: boolWhether this protocol has causal/temporal ordering (ThCausal).
nominal_identity: boolWhether this protocol uses nominal identity (ThNominal).
has_defaults: boolWhether this protocol supports default value expressions (ThValued).
has_coercions: boolWhether this protocol supports type coercion expressions (ThCoercible).
has_mergers: boolWhether this protocol supports merge/split expressions (ThMergeable).
has_policies: boolWhether this protocol supports conflict resolution policies (ThPolicied).
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.