#[non_exhaustive]pub enum FromSqlError {
InvalidType,
OutOfRange(i64),
InvalidBlobSize {
expected_size: usize,
blob_size: usize,
},
Other(Box<dyn Error + Send + Sync + 'static>),
}
Expand description
Enum listing possible errors from FromSql
trait.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidType
Error when an SQLite value is requested, but the type of the result cannot be converted to the requested Rust type.
OutOfRange(i64)
Error when the i64 value returned by SQLite cannot be stored into the requested type.
InvalidBlobSize
Error when the blob result returned by SQLite cannot be stored into the requested type due to a size mismatch.
Fields
Other(Box<dyn Error + Send + Sync + 'static>)
An error case available for implementors of the FromSql
trait.
Implementations§
Source§impl FromSqlError
impl FromSqlError
Sourcepub fn other<E: Error + Send + Sync + 'static>(error: E) -> Self
pub fn other<E: Error + Send + Sync + 'static>(error: E) -> Self
Converts an arbitrary error type to FromSqlError
.
This is a convenience function that boxes and unsizes the error type. It’s main purpose is
to be usable in the map_err
method. So instead of
result.map_err(|error| FromSqlError::Other(Box::new(error))
you can write
result.map_err(FromSqlError::other)
.
Trait Implementations§
Source§impl Debug for FromSqlError
impl Debug for FromSqlError
Source§impl Display for FromSqlError
impl Display for FromSqlError
Source§impl Error for FromSqlError
impl Error for FromSqlError
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
Source§impl From<FromSqlError> for Error
The conversion isn’t precise, but it’s convenient to have it
to allow use of get_raw(…).as_…()?
in callbacks that take Error
.
impl From<FromSqlError> for Error
The conversion isn’t precise, but it’s convenient to have it
to allow use of get_raw(…).as_…()?
in callbacks that take Error
.
Source§fn from(err: FromSqlError) -> Self
fn from(err: FromSqlError) -> Self
Source§impl PartialEq for FromSqlError
impl PartialEq for FromSqlError
Auto Trait Implementations§
impl Freeze for FromSqlError
impl !RefUnwindSafe for FromSqlError
impl Send for FromSqlError
impl Sync for FromSqlError
impl Unpin for FromSqlError
impl !UnwindSafe for FromSqlError
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
InvalidType
: 0 bytesOutOfRange
: 8 bytesInvalidBlobSize
: 16 bytesOther
: 16 bytes