pub enum QueryError {
Show 13 variants
ConnectionError {
message: String,
},
ExecutionError {
message: String,
},
ParseError {
message: String,
},
TypeMismatch {
expected: String,
actual: String,
},
MissingField {
field: String,
},
TransactionError {
message: String,
},
UnsupportedLanguage {
language: String,
},
ParameterError {
message: String,
},
RowNotFound,
MultipleRowsFound {
count: usize,
},
IoError(Error),
SerializationError {
message: String,
},
Other(String),
}Expand description
Errors that can occur during query execution
This enum covers all possible runtime errors including connection issues, query execution failures, type mismatches, and more.
Variants§
ConnectionError
Database connection error
ExecutionError
Query execution error
ParseError
Query parsing error (should be rare, as parsing is done at compile time)
TypeMismatch
Type mismatch during result deserialization
MissingField
Missing required field in result
TransactionError
Transaction error
UnsupportedLanguage
Unsupported query language
ParameterError
Invalid parameter binding
RowNotFound
Row not found
MultipleRowsFound
Multiple rows found when one was expected
IoError(Error)
I/O error
SerializationError
Serialization/deserialization error
Other(String)
Generic error for cases not covered above
Implementations§
Source§impl QueryError
impl QueryError
Sourcepub fn connection<S: Into<String>>(message: S) -> Self
pub fn connection<S: Into<String>>(message: S) -> Self
Create a connection error
Sourcepub fn type_mismatch<S: Into<String>>(expected: S, actual: S) -> Self
pub fn type_mismatch<S: Into<String>>(expected: S, actual: S) -> Self
Create a type mismatch error
Sourcepub fn missing_field<S: Into<String>>(field: S) -> Self
pub fn missing_field<S: Into<String>>(field: S) -> Self
Create a missing field error
Sourcepub fn transaction<S: Into<String>>(message: S) -> Self
pub fn transaction<S: Into<String>>(message: S) -> Self
Create a transaction error
Sourcepub fn serialization<S: Into<String>>(message: S) -> Self
pub fn serialization<S: Into<String>>(message: S) -> Self
Create a serialization error
Trait Implementations§
Source§impl Debug for QueryError
impl Debug for QueryError
Source§impl Display for QueryError
impl Display for QueryError
Source§impl Error for QueryError
impl Error for QueryError
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 QueryError
impl !RefUnwindSafe for QueryError
impl Send for QueryError
impl Sync for QueryError
impl Unpin for QueryError
impl !UnwindSafe for QueryError
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