pub struct PropertyConstraintSpec {
pub name: String,
pub scope: ConstraintScope,
pub properties: Vec<String>,
pub kind: PropertyConstraintKind,
}Expand description
Declarative spec for a property constraint. Unlike
PropertyIndexSpec, constraints carry a user-facing name —
DROP CONSTRAINT takes a name, not a (scope, properties, kind)
tuple, so the registry keys on name for lookup. When the user
omits the name, StorageEngine::create_property_constraint fills
in a deterministic one derived from the other fields.
properties is a list so that PropertyConstraintKind::NodeKey
can carry its composite tuple here alongside single-property kinds;
the single-property kinds (Unique, NotNull, PropertyType)
enforce a length-one invariant at creation time.
Fields§
§name: String§scope: ConstraintScope§properties: Vec<String>§kind: PropertyConstraintKindImplementations§
Source§impl PropertyConstraintSpec
impl PropertyConstraintSpec
Sourcepub fn primary_property(&self) -> &str
pub fn primary_property(&self) -> &str
The constraint’s first (and for single-property kinds, only) property name. Handy shorthand for call sites that already know the spec is single-property.
Trait Implementations§
Source§impl Clone for PropertyConstraintSpec
impl Clone for PropertyConstraintSpec
Source§fn clone(&self) -> PropertyConstraintSpec
fn clone(&self) -> PropertyConstraintSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropertyConstraintSpec
impl Debug for PropertyConstraintSpec
Source§impl Hash for PropertyConstraintSpec
impl Hash for PropertyConstraintSpec
Source§impl PartialEq for PropertyConstraintSpec
impl PartialEq for PropertyConstraintSpec
impl Eq for PropertyConstraintSpec
impl StructuralPartialEq for PropertyConstraintSpec
Auto Trait Implementations§
impl Freeze for PropertyConstraintSpec
impl RefUnwindSafe for PropertyConstraintSpec
impl Send for PropertyConstraintSpec
impl Sync for PropertyConstraintSpec
impl Unpin for PropertyConstraintSpec
impl UnsafeUnpin for PropertyConstraintSpec
impl UnwindSafe for PropertyConstraintSpec
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
Mutably borrows from an owned value. Read more