Skip to main content

ErrorReason

Enum ErrorReason 

Source
#[non_exhaustive]
pub enum ErrorReason {
Show 14 variants Aborted(AbortError), Authorization(AuthorizationError), Busy(BusyError), CantOpen(CantOpenError), Constraint(ConstraintError), Corrupt(CorruptError), Error(GeneralError), Io(IoError), Locked(LockedError), ReadOnly(ReadOnlyError), Row(RowError), Fetch(FetchError), Parameter(ParameterError), TextEncoding(TextEncodingError),
}
Expand description

Extended SQLite result codes that provide more specific information about errors.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Aborted(AbortError)

Specific reasons for an ErrorCategory::Aborted.

§

Authorization(AuthorizationError)

Specific reason for an ErrorCategory::Authorization.

§

Busy(BusyError)

Specific reason for an ErrorCategory::Busy.

§

CantOpen(CantOpenError)

Specific reason for an ErrorCategory::CantOpen.

§

Constraint(ConstraintError)

Specific reason for an ErrorCategory::Constraint.

§

Corrupt(CorruptError)

Specific reason for an ErrorCategory::Corrupt.

§

Error(GeneralError)

Specific reason for an ErrorCategory::Unknown.

§

Io(IoError)

Specific reason for an ErrorCategory::Io.

§

Locked(LockedError)

Specific reason for an ErrorCategory::Locked.

§

ReadOnly(ReadOnlyError)

Specific reason for an ErrorCategory::ReadOnly.

§

Row(RowError)

Specific reason for an ErrorCategory::Row.

(This error code is defined by Squire; not SQLite. No SQLite result codes correspond to ErrorReason::Row.)

§

Fetch(FetchError)

Specific reason for an ErrorCategory::Fetch.

(This error code is defined by Squire; not SQLite. No SQLite result codes correspond to ErrorReason::Fetch.)

§

Parameter(ParameterError)

Specific reason for an ErrorCategory::Parameter.

(This error code is defined by Squire; not SQLite. No SQLite result codes correspond to ErrorReason::Parameter.)

§

TextEncoding(TextEncodingError)

Specific reason for an ErrorCategory::TextEncoding.

(This error code is defined by Squire; not SQLite. No SQLite result codes correspond to ErrorReason::Parameter.)

Implementations§

Source§

impl ErrorReason

Source

pub const fn is_aborted(&self) -> bool

Returns true if this value is of type Aborted. Returns false otherwise

Source

pub const fn is_authorization(&self) -> bool

Returns true if this value is of type Authorization. Returns false otherwise

Source

pub const fn is_busy(&self) -> bool

Returns true if this value is of type Busy. Returns false otherwise

Source

pub const fn is_cant_open(&self) -> bool

Returns true if this value is of type CantOpen. Returns false otherwise

Source

pub const fn is_constraint(&self) -> bool

Returns true if this value is of type Constraint. Returns false otherwise

Source

pub const fn is_corrupt(&self) -> bool

Returns true if this value is of type Corrupt. Returns false otherwise

Source

pub const fn is_error(&self) -> bool

Returns true if this value is of type Error. Returns false otherwise

Source

pub const fn is_io(&self) -> bool

Returns true if this value is of type Io. Returns false otherwise

Source

pub const fn is_locked(&self) -> bool

Returns true if this value is of type Locked. Returns false otherwise

Source

pub const fn is_read_only(&self) -> bool

Returns true if this value is of type ReadOnly. Returns false otherwise

Source

pub const fn is_row(&self) -> bool

Returns true if this value is of type Row. Returns false otherwise

Source

pub const fn is_fetch(&self) -> bool

Returns true if this value is of type Fetch. Returns false otherwise

Source

pub const fn is_parameter(&self) -> bool

Returns true if this value is of type Parameter. Returns false otherwise

Source

pub const fn is_text_encoding(&self) -> bool

Returns true if this value is of type TextEncoding. Returns false otherwise

Source§

impl ErrorReason

Source

pub const fn category(self) -> ErrorCategory

Returns the primary error category for this extended error code.

Source

pub const fn code(self) -> ErrorCode

Returns the underlying ErrorCode.

Source

pub const fn from_code(code: ErrorCode) -> Option<Self>

Find the ErrorReason for an ErrorCode.

Source

pub const fn from_raw_code(code: i32) -> Option<Self>

Find the ErrorReason for a SQLite result code.

Trait Implementations§

Source§

impl Clone for ErrorReason

Source§

fn clone(&self) -> ErrorReason

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErrorReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<AbortError> for ErrorReason

Source§

fn from(value: AbortError) -> Self

Converts to this type from the input type.
Source§

impl From<AuthorizationError> for ErrorReason

Source§

fn from(value: AuthorizationError) -> Self

Converts to this type from the input type.
Source§

impl From<BusyError> for ErrorReason

Source§

fn from(value: BusyError) -> Self

Converts to this type from the input type.
Source§

impl From<CantOpenError> for ErrorReason

Source§

fn from(value: CantOpenError) -> Self

Converts to this type from the input type.
Source§

impl From<ConstraintError> for ErrorReason

Source§

fn from(value: ConstraintError) -> Self

Converts to this type from the input type.
Source§

impl From<CorruptError> for ErrorReason

Source§

fn from(value: CorruptError) -> Self

Converts to this type from the input type.
Source§

impl From<FetchError> for ErrorReason

Source§

fn from(value: FetchError) -> Self

Converts to this type from the input type.
Source§

impl From<GeneralError> for ErrorReason

Source§

fn from(value: GeneralError) -> Self

Converts to this type from the input type.
Source§

impl From<IoError> for ErrorReason

Source§

fn from(value: IoError) -> Self

Converts to this type from the input type.
Source§

impl From<LockedError> for ErrorReason

Source§

fn from(value: LockedError) -> Self

Converts to this type from the input type.
Source§

impl From<ParameterError> for ErrorReason

Source§

fn from(value: ParameterError) -> Self

Converts to this type from the input type.
Source§

impl From<ReadOnlyError> for ErrorReason

Source§

fn from(value: ReadOnlyError) -> Self

Converts to this type from the input type.
Source§

impl From<RowError> for ErrorReason

Source§

fn from(value: RowError) -> Self

Converts to this type from the input type.
Source§

impl From<TextEncodingError> for ErrorReason

Source§

fn from(value: TextEncodingError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ErrorReason

Source§

fn eq(&self, other: &ErrorReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ErrorReason

Source§

impl Eq for ErrorReason

Source§

impl StructuralPartialEq for ErrorReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.