pub enum ConstraintViolation {
MissingProperty {
constraint: String,
entity: StoredIndexEntity,
label: String,
property: String,
},
MissingPropertiesForKey {
constraint: String,
entity: StoredIndexEntity,
label: String,
properties: Vec<String>,
},
WrongPropertyType {
constraint: String,
entity: StoredIndexEntity,
label: String,
property: String,
expected: String,
},
UniquenessViolated {
constraint: String,
entity: StoredIndexEntity,
label: String,
property: String,
},
}Expand description
Why a mutation was rejected by a constraint check. The codes match the Neo4j GQLSTATUS shapes:
- 22N77 — property presence verification failed.
- 22N78 — property type verification failed.
- 22N79 — property uniqueness constraint violated.
- 22N80 — index entry conflict (duplicate row found by the backing index during a CREATE CONSTRAINT scan).
- 50N11 — generic “constraint creation failed” wrapper used at DDL time to surface the underlying 22N7x error.
Variants§
Implementations§
Source§impl ConstraintViolation
impl ConstraintViolation
pub const fn gql_status(&self) -> &'static str
pub fn constraint_name(&self) -> &str
Trait Implementations§
Source§impl Clone for ConstraintViolation
impl Clone for ConstraintViolation
Source§fn clone(&self) -> ConstraintViolation
fn clone(&self) -> ConstraintViolation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConstraintViolation
impl Debug for ConstraintViolation
Source§impl Display for ConstraintViolation
impl Display for ConstraintViolation
Source§impl Error for ConstraintViolation
impl Error for ConstraintViolation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ConstraintViolation
impl RefUnwindSafe for ConstraintViolation
impl Send for ConstraintViolation
impl Sync for ConstraintViolation
impl Unpin for ConstraintViolation
impl UnsafeUnpin for ConstraintViolation
impl UnwindSafe for ConstraintViolation
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