Enum mentat_db::errors::SchemaConstraintViolation [] [src]

pub enum SchemaConstraintViolation {
    ConflictingUpserts {
        conflicting_upserts: BTreeMap<TempId, BTreeSet<KnownEntid>>,
    },
    TypeDisagreements {
        conflicting_datoms: BTreeMap<(Entid, Entid, TypedValue), ValueType>,
    },
    CardinalityConflicts {
        conflicts: Vec<CardinalityConflict>,
    },
}

Variants

A transaction tried to assert datoms where one tempid upserts to two (or more) distinct entids.

Fields of ConflictingUpserts

A map from tempid to the entids it would upsert to.

In the future, we might even be able to attribute the upserts to particular (reduced) datoms, i.e., to particular [e a v] triples that caused the constraint violation. Attributing constraint violations to input data is more difficult to the multiple rewriting passes the input undergoes.

A transaction tried to assert a datom or datoms with the wrong value v type(s).

Fields of TypeDisagreements

The key ([e a v]) has an invalid value v: it is not of the expected value type.

A transaction tried to assert datoms that don't observe the schema's cardinality constraints.

Fields of CardinalityConflicts

Trait Implementations

impl Clone for SchemaConstraintViolation
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for SchemaConstraintViolation
[src]

Formats the value using the given formatter. Read more

impl Eq for SchemaConstraintViolation
[src]

impl PartialEq for SchemaConstraintViolation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Fail for SchemaConstraintViolation
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

Provides context for this failure. Read more

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

impl Display for SchemaConstraintViolation
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for SchemaConstraintViolation

impl Sync for SchemaConstraintViolation