#[non_exhaustive]pub enum RelError {
UniqueViolation {
constraint: Option<String>,
},
ForeignKeyViolation {
constraint: Option<String>,
},
CheckViolation {
constraint: Option<String>,
},
Serialization,
Deadlock,
Unavailable(String),
Unsupported(String),
Timeout {
after: Duration,
},
Backend(String),
}Expand description
Why a relational operation failed, classified so a caller can branch without parsing driver text (Humboldt hand-maps constraint names in at least seven places today). Plain data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UniqueViolation
A unique or primary-key constraint rejected the statement.
ForeignKeyViolation
A foreign-key constraint rejected the statement.
CheckViolation
A check constraint (or NOT NULL) rejected the statement.
Serialization
The transaction could not be serialised; retrying it may succeed.
Deadlock
The server chose this transaction as a deadlock victim; retrying it may succeed.
The server could not be reached or went away.
Unsupported(String)
The backend cannot do this, and says so rather than approximating.
Timeout
A call did not finish within the configured per-call bound and was cut off. For a statement outside a transaction, whether it took effect is unknown; a transaction that saw one is rolled back and refuses to commit.
Backend(String)
Any other failure; the text is the driver’s.
Trait Implementations§
impl Eq for RelError
Source§impl Error for RelError
impl Error for RelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()