pub trait SqlError: Sized {
// Required methods
fn fk_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>;
fn unique_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>;
}
Expand description
Trait for mapping certain postgres errors.
Required Methods§
Sourcefn fk_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>
fn fk_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>
Map a foreign key violation to a different error type.
Sourcefn unique_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>
fn unique_violation<E, F: FnOnce() -> E>(self, f: F) -> Result<Self, E>
Map a unique violation to a different error type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.