#[non_exhaustive]pub enum PrimaryCode {
Show 31 variants
Ok,
Error,
Internal,
Perm,
Abort,
Busy,
Locked,
NoMem,
ReadOnly,
Interrupt,
IoErr,
Corrupt,
NotFound,
Full,
CantOpen,
Protocol,
Empty,
Schema,
TooBig,
Constraint,
Mismatch,
Misuse,
NoLfs,
Auth,
Format,
Range,
NotADb,
Notice,
Warning,
Row,
Done,
}Expand description
A SQLite primary result code.
Generated from compat/errors.toml; do not edit by hand.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ok
SQLITE_OK (0).
Error
SQLITE_ERROR (1).
Internal
SQLITE_INTERNAL (2).
Perm
SQLITE_PERM (3).
Abort
SQLITE_ABORT (4).
Busy
SQLITE_BUSY (5).
Locked
SQLITE_LOCKED (6).
NoMem
SQLITE_NOMEM (7).
ReadOnly
SQLITE_READONLY (8).
Interrupt
SQLITE_INTERRUPT (9).
IoErr
SQLITE_IOERR (10).
Corrupt
SQLITE_CORRUPT (11).
NotFound
SQLITE_NOTFOUND (12).
Full
SQLITE_FULL (13).
CantOpen
SQLITE_CANTOPEN (14).
Protocol
SQLITE_PROTOCOL (15).
Empty
SQLITE_EMPTY (16).
Schema
SQLITE_SCHEMA (17).
TooBig
SQLITE_TOOBIG (18).
Constraint
SQLITE_CONSTRAINT (19).
Mismatch
SQLITE_MISMATCH (20).
Misuse
SQLITE_MISUSE (21).
NoLfs
SQLITE_NOLFS (22).
Auth
SQLITE_AUTH (23).
Format
SQLITE_FORMAT (24).
Range
SQLITE_RANGE (25).
NotADb
SQLITE_NOTADB (26).
Notice
SQLITE_NOTICE (27).
Warning
SQLITE_WARNING (28).
Row
SQLITE_ROW (100).
Done
SQLITE_DONE (101).
Implementations§
Source§impl PrimaryCode
impl PrimaryCode
Sourcepub fn row(self) -> &'static PrimaryRow
pub fn row(self) -> &'static PrimaryRow
Returns the generated row for this code.
Every variant comes from the manifest, so the lookup always succeeds;
the fallback keeps the function total without an unwrap.
Sourcepub fn from_code(number: i32) -> Option<PrimaryCode>
pub fn from_code(number: i32) -> Option<PrimaryCode>
Resolves a numeric primary code, returning None for a number the
manifest does not list.
Named for what it takes. It was from_value until task-1961, which is
the name of the datum-to-SQL-value conversion everywhere else in this
workspace, and this function has nothing to do with that one: its
argument is an error number out of compat/errors.toml.