Skip to main content

ErrorCategory

Enum ErrorCategory 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum ErrorCategory {
Show 29 variants Unknown = 1, Internal = 2, Permission = 3, Aborted = 4, Busy = 5, Locked = 6, OutOfMemory = 7, ReadOnly = 8, Interrupt = 9, Io = 10, Corrupt = 11, NotFound = 12, Full = 13, CantOpen = 14, Protocol = 15, Empty = 16, Schema = 17, TooBig = 18, Constraint = 19, Mismatch = 20, Misuse = 21, LargeFile = 22, Authorization = 23, Format = 24, Range = 25, InvalidDatabase = 26, Fetch = 193, Parameter = 194, Row = 195,
}
Expand description

The category of Error that occurred.

Error categories correspond to a SQLite primary result code, except for those defined by Squire itself (Fetch, Parameter, and Row).

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.
§

Unknown = 1

A generic error code that SQLite returns when no specific error code is available.

§

Internal = 2

Indicates an internal error (bug) in SQLite, an application-defined function, virtual table, VFS, or extension.

§

Permission = 3

The requested access mode for a newly created database could not be provided.

§

Aborted = 4

An operation was aborted prior to completion, usually by application request.

§

Busy = 5

The database file could not be written (or in some cases read) because of concurrent activity by some other database connection.

§

Locked = 6

A write operation could not continue because of a conflict within the same database connection or a conflict with a different database connection that uses a shared cache.

§

OutOfMemory = 7

SQLite was unable to allocate all the memory it needed to complete the operation.

§

ReadOnly = 8

An attempt is made to alter some data for which the current database connection does not have write permission.

§

Interrupt = 9

An operation was interrupted by the sqlite3_interrupt() interface.

§

Io = 10

The operation could not finish because the operating system reported an I/O error.

§

Corrupt = 11

The database file has been corrupted.

§

NotFound = 12

Used internally by SQLite, not typically exposed to applications.

§

Full = 13

A write could not complete because the disk is full.

§

CantOpen = 14

SQLite was unable to open a file.

§

Protocol = 15

A problem with the file locking protocol used by SQLite.

§

Empty = 16

👎Deprecated

Not currently used by SQLite.

§

Schema = 17

The database schema has changed.

§

TooBig = 18

A string or BLOB was too large.

§

Constraint = 19

A SQL constraint violation occurred.

§

Mismatch = 20

A datatype mismatch occurred.

§

Misuse = 21

The application uses any SQLite interface in a way that is undefined or unsupported.

§

LargeFile = 22

The system does not support large files when the database grows to be larger than what the filesystem can handle.

§

Authorization = 23

The authorizer callback indicates that a SQL statement being prepared is not authorized.

§

Format = 24

👎Deprecated

Not currently used by SQLite.

§

Range = 25

The parameter number argument to one of the sqlite3_bind routines or the column number in one of the sqlite3_column routines is out of range.

§

InvalidDatabase = 26

When attempting to open a file, the file being opened does not appear to be a SQLite database file.

§

Fetch = 193

A column value stored in SQLite could not be read into a Rust type.

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

§

Parameter = 194

A parameter could not be bound; the error message gives more detail about the underlying error.

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

§

Row = 195

A column value stored in SQLite could not be read into a Rust type.

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

Implementations§

Source§

impl ErrorCategory

Source

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

Find the ErrorCategory for an ErrorCode.

Source

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

Find the ErrorCategory for a SQLite result code.

Source

pub const fn code(self) -> ErrorCode

Returns the underlying ErrorCode.

Trait Implementations§

Source§

impl Clone for ErrorCategory

Source§

fn clone(&self) -> ErrorCategory

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 ErrorCategory

Source§

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

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

impl From<ErrorCategory> for Error

Source§

fn from(category: ErrorCategory) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ErrorCategory

Source§

fn eq(&self, other: &ErrorCategory) -> 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 ErrorCategory

Source§

impl Eq for ErrorCategory

Source§

impl StructuralPartialEq for ErrorCategory

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.