pub enum ConstraintType {
Unique,
Key,
Exists,
PropertyType,
LabelExistence,
NodeLabelExistence,
SourceLabel,
SourceLabelExistence,
TargetLabel,
TargetLabelExistence,
}Expand description
The kind of a schema Constraint, persisted as
Constraint::constraint_type.
Replaces the previous stringly-typed constraint_type: String. The serde
representation is the exact tag written by earlier versions, so pre-enum
databases load unchanged, and an unknown tag is a hard deserialization
error instead of being silently ignored by a _ => {} catch-all.
Variants§
Unique
Key
Exists
PropertyType
LabelExistence
A node label-existence constraint derived from a graph type
(ALTER CURRENT GRAPH TYPE).
NodeLabelExistence
The standalone REQUIRE alias:Label node label-existence form.
SourceLabel
A relationship source-label constraint derived from a graph type.
SourceLabelExistence
The standalone relationship source-label form.
TargetLabel
A relationship target-label constraint derived from a graph type.
TargetLabelExistence
The standalone relationship target-label form.
Implementations§
Source§impl ConstraintType
impl ConstraintType
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
The canonical stored tag — identical to the serde representation and to
the pre-enum Constraint::constraint_type string.
Sourcepub fn is_index_backed(&self) -> bool
pub fn is_index_backed(&self) -> bool
Whether this constraint kind is backed by a range index — the two kinds
(unique/key) that share one physical backing index per schema.
Sourcepub fn is_enforced_label_kind(&self) -> bool
pub fn is_enforced_label_kind(&self) -> bool
Whether this kind is one of the six label/endpoint-label existence kinds
that carry an enforced label (CIP-187): labelExistence,
nodeLabelExistence, sourceLabel, sourceLabelExistence,
targetLabel, targetLabelExistence. Single source of truth for the
string check in the executor’s requires_enforced_label.
Sourcepub fn enforced_label_site(&self) -> Option<EnforcedLabelSite>
pub fn enforced_label_site(&self) -> Option<EnforcedLabelSite>
Where an enforced-label kind checks its enforced label: on the
constrained node, or on the start or end node of the constrained
relationship. None for every kind that carries no enforced label.
This is the typed form of the enforced-label entity split: the kind
attaches to a relationship iff the site is not
EnforcedLabelSite::Node.
Sourcepub fn enforces_uniqueness(&self) -> bool
pub fn enforces_uniqueness(&self) -> bool
Whether this kind enforces uniqueness of the constrained properties:
unique and key (a key constraint is uniqueness + existence).
Today this is exactly the index-backed set, but the predicate is
named for the semantic guarantee, not the physical backing.
Sourcepub fn enforces_property_presence(&self) -> bool
pub fn enforces_property_presence(&self) -> bool
Whether this kind requires the constrained properties to be present
(non-null) on every matching entity: exists, and key (a key
property must exist). The enforced-label kinds
(ConstraintType::is_enforced_label_kind) enforce label presence,
not property presence, so they are excluded.
Source§impl ConstraintType
impl ConstraintType
Sourcepub fn unknown_kind_message(name: &str, reason: &str) -> String
pub fn unknown_kind_message(name: &str, reason: &str) -> String
The one spelling of the pinned unknown-kind reply
(ConstraintValidationFailed: unknown constraint type "…"),
shared by the catalog’s durable-row gate and the executor’s validator.
Trait Implementations§
Source§impl Clone for ConstraintType
impl Clone for ConstraintType
impl Copy for ConstraintType
Source§impl Debug for ConstraintType
impl Debug for ConstraintType
Source§impl<'de> Deserialize<'de> for ConstraintType
impl<'de> Deserialize<'de> for ConstraintType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ConstraintType
impl Display for ConstraintType
impl Eq for ConstraintType
Source§impl FromStr for ConstraintType
impl FromStr for ConstraintType
Source§impl Hash for ConstraintType
impl Hash for ConstraintType
Source§impl PartialEq for ConstraintType
impl PartialEq for ConstraintType
Source§impl PartialEq<&str> for ConstraintType
impl PartialEq<&str> for ConstraintType
Source§impl PartialEq<str> for ConstraintType
impl PartialEq<str> for ConstraintType
Source§impl Serialize for ConstraintType
impl Serialize for ConstraintType
impl StructuralPartialEq for ConstraintType
Auto Trait Implementations§
impl Forget for ConstraintType
impl Freeze for ConstraintType
impl Move for ConstraintType
impl RefUnwindSafe for ConstraintType
impl Send for ConstraintType
impl Sync for ConstraintType
impl Unpin for ConstraintType
impl UnsafeUnpin for ConstraintType
impl UnwindSafe for ConstraintType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.