pub struct GraphTypeSpec {
pub node_types: Vec<NodeTypeModel>,
pub edge_types: Vec<EdgeTypeModel>,
pub constraints: Vec<GraphTypeConstraintModel>,
pub drop_constraint_names: Vec<String>,
}Expand description
The typed, serde-serializable form of a parsed
GraphTypeBody (CIP-176/178/180). Graph-type redo ops
(RedoOp::PutGraphType / RedoOp::SetCurrentGraphType) carry this
model and TheaterData stores it: parsing happens once at
DDL-execution time (GraphTypeSpec::from_body), and redo replay
converts back with GraphTypeSpec::to_body – an infallible,
mechanical conversion, never a re-parse of Cypher text.
Fields§
§node_types: Vec<NodeTypeModel>§edge_types: Vec<EdgeTypeModel>§constraints: Vec<GraphTypeConstraintModel>§drop_constraint_names: Vec<String>Implementations§
Source§impl GraphTypeSpec
impl GraphTypeSpec
Sourcepub fn from_body(body: &GraphTypeBody) -> Result<Self, EngineError>
pub fn from_body(body: &GraphTypeBody) -> Result<Self, EngineError>
Captures a parsed GraphTypeBody into its persisted model. A
property default value whose expression is not one of the
CIP-262 allowed shapes fails here (the same shape the body
validator rejects) rather than being captured lossily – the
capture stays fail-closed even for a caller that skipped
validation. An unresolved OPTIONS $param on a constraint fails
here too (its caller resolves parameters first), so the persisted
model only ever carries literal option values.
Sourcepub fn to_body(&self) -> GraphTypeBody
pub fn to_body(&self) -> GraphTypeBody
Rebuilds the parser model for the semantic layer
(validate_graph_type_body, derive_constraints,
canonicalize_graph_type_body, …). Infallible.