pub struct Constraint {
pub name: String,
pub label: String,
pub properties: Vec<String>,
pub constraint_type: ConstraintType,
pub property_type: Option<String>,
pub entity_type: String,
pub enforced_label: Option<String>,
}Expand description
A schema constraint (unique, exists, key, propertyType, or – CIP-186/ CIP-187 – one of the graph-type-derived kinds labelExistence/ sourceLabel/targetLabel).
Fields§
§name: String§label: String§properties: Vec<String>§constraint_type: ConstraintTypeThe constraint kind (ConstraintType). Serialized as the exact tag
("unique", "propertyType", …).
property_type: Option<String>The CIP-100-normalized type string for a "propertyType"
constraint (CIP-85), None for every other constraint_type.
#[serde(default)] keeps JSON databases written before this field
existed loadable.
entity_type: String“NODE” or “RELATIONSHIP” (CIP-11). #[serde(default)] keeps JSON
databases written before this field existed loadable.
enforced_label: Option<String>The label a "labelExistence"/"sourceLabel"/"targetLabel"
graph-type-derived constraint (CIP-187) requires to be present –
SHOW CONSTRAINTS’s enforcedLabel column. None for every other
constraint_type. #[serde(default)] keeps JSON databases written
before this field existed loadable.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn entity_kind(&self) -> Result<EntityKind, String>
pub fn entity_kind(&self) -> Result<EntityKind, String>
The entity kind this constraint names. The one classifier every durable boundary (WAL preflight, checkpoint theater, JSON decode) routes through, so a value naming neither kind has one message.