Enum FromSqlError
#[non_exhaustive]pub enum FromSqlError {
InvalidType,
OutOfRange(i64),
Utf8Error(Utf8Error),
InvalidBlobSize {
expected_size: usize,
blob_size: usize,
},
Other(Box<dyn Error + Send + Sync>),
}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.
Utf8Error(Utf8Error)
Error converting a string to UTF-8.
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>)
An error case available for implementors of the FromSql trait.
Implementations§
§impl FromSqlError
impl FromSqlError
pub fn other<E>(error: E) -> FromSqlError
pub fn other<E>(error: E) -> FromSqlError
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§
§impl Debug for FromSqlError
impl Debug for FromSqlError
§impl Display for FromSqlError
impl Display for FromSqlError
§impl Error for FromSqlError
impl Error for FromSqlError
§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()
§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.
§fn from(err: FromSqlError) -> Error
fn from(err: FromSqlError) -> Error
§impl From<Utf8Error> for FromSqlError
impl From<Utf8Error> for FromSqlError
§fn from(err: Utf8Error) -> FromSqlError
fn from(err: Utf8Error) -> FromSqlError
Auto Trait Implementations§
impl !RefUnwindSafe for FromSqlError
impl !UnwindSafe for FromSqlError
impl Freeze for FromSqlError
impl Send for FromSqlError
impl Sync for FromSqlError
impl Unpin for FromSqlError
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> HostError for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more