pub enum Error {
Sqlite(i32, Option<String>),
Utf8Error(Utf8Error),
NulError(NulError),
VersionNotSatisfied(c_int),
Module(String),
NoChange,
}
Variants§
Sqlite(i32, Option<String>)
An error returned by SQLite.
Utf8Error(Utf8Error)
A string received from SQLite contains invalid UTF-8, and cannot be converted to a
&str
.
NulError(NulError)
A string being passed from Rust to SQLite contained an interior nul byte.
VersionNotSatisfied(c_int)
Caused by an attempt to use an API that is not supported in the current version of SQLite.
Module(String)
An arbitrary string error message. This is never generated by SQLite or sqlite3_ext, but can be used by consumers of this crate to cause SQLite to fail with a particular error message.
NoChange
The result was not necessary to produce because it is an unchanged column in an UPDATE operation. See ValueRef::nochange for details.
Implementations§
Source§impl Error
impl Error
Sourcepub fn from_sqlite(rc: i32) -> Result<()>
pub fn from_sqlite(rc: i32) -> Result<()>
Convert the return of an SQLite function into a Result<()>. This method properly handles the non-error result codes (SQLITE_OK, SQLITE_ROW, and SQLITE_DONE).
Sourcepub fn from_sqlite_desc(
rc: i32,
guard: SQLiteMutexGuard<'_, Connection>,
) -> Result<()>
pub fn from_sqlite_desc( rc: i32, guard: SQLiteMutexGuard<'_, Connection>, ) -> Result<()>
Convert the return of an SQLite function into a Result<()>, with a complete error message. This method is similar to from_sqlite, except that it retrieves the full error message from SQLite in addition to the error code.
Sourcepub unsafe fn from_sqlite_desc_unchecked(
rc: i32,
conn: *mut sqlite3,
) -> Result<()>
pub unsafe fn from_sqlite_desc_unchecked( rc: i32, conn: *mut sqlite3, ) -> Result<()>
Equivalent to from_sqlite_desc, but without requiring a lock on the database.
§Safety
This method is safe, however it may produce incorrect results if called while a lock on the SQLite database is not held.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
impl Eq for Error
impl StructuralPartialEq for Error
impl ToContextResult for Error
Sets the context error to this error.