Error

Enum Error 

Source
pub enum Error {
Show 60 variants TableNotFound, TableAlreadyExists, TableClosed, TableColumnsNotMatch { expected: usize, got: usize, }, ColumnNotFound, ColumnNotFoundByName { name: String, }, InvalidColumnType, DuplicateColumn, InvalidValue, InvalidArgument { message: String, }, ValueTooLong { column: String, max: usize, got: usize, }, NotNullConstraint { column: String, }, PrimaryKeyConstraint { row_id: i64, }, UniqueConstraint { index: String, column: String, value: String, }, CheckConstraintViolation { column: String, expression: String, }, TransactionNotStarted, TransactionAlreadyStarted, TransactionEnded, TransactionAborted, TransactionCommitted, TransactionClosed, IndexNotFound, IndexAlreadyExists, IndexAlreadyExistsByName(String), IndexNotFoundByName(String), IndexColumnNotFound, IndexClosed, EngineNotOpen, EngineAlreadyOpen, ViewAlreadyExists(String), ViewNotFound(String), LockAcquisitionFailed(String), NoRowsReturned, NoStatementsToExecute, ColumnIndexOutOfBounds { index: usize, }, WalNotRunning, WalFileClosed, WalNotInitialized, DatabaseLocked, CannotDropPrimaryKey, NullComparison, IncomparableTypes, NotSupported, SegmentNotFound, ExpressionEvaluation, ExpressionEvaluationWithMessage { message: String, }, TypeConversion { from: String, to: String, }, Parse { message: String, }, Io { message: String, }, Internal { message: String, }, TableExists(String), TableNotFoundByName(String), TableOrViewNotFound(String), ColumnNotFoundNamed(String), Type(String), DivisionByZero, QueryCancelled, NotSupportedMessage(String), ParseError(String), InvalidArgumentMessage(String),
}
Expand description

Main error type for Stoolap storage operations

This enum covers all error cases including both sentinel errors and structured errors with context.

Variants§

§

TableNotFound

Table not found in the database

§

TableAlreadyExists

Table already exists when trying to create

§

TableClosed

Table has been closed and cannot be used

§

TableColumnsNotMatch

Table column count mismatch

Fields

§expected: usize
§got: usize
§

ColumnNotFound

Column not found in table schema

§

ColumnNotFoundByName

Column not found by name (with name context)

Fields

§name: String
§

InvalidColumnType

Invalid column type for operation

§

DuplicateColumn

Duplicate column name in schema

§

InvalidValue

Invalid value for operation

§

InvalidArgument

Invalid argument for function

Fields

§message: String
§

ValueTooLong

Value exceeds maximum length

Fields

§column: String
§max: usize
§got: usize
§

NotNullConstraint

NOT NULL constraint violation

Fields

§column: String
§

PrimaryKeyConstraint

Primary key constraint violation

Fields

§row_id: i64
§

UniqueConstraint

Unique constraint violation

Fields

§index: String
§column: String
§value: String
§

CheckConstraintViolation

CHECK constraint violation

Fields

§column: String
§expression: String
§

TransactionNotStarted

Transaction has not been started

§

TransactionAlreadyStarted

Transaction has already been started

§

TransactionEnded

Transaction has already ended (committed or rolled back)

§

TransactionAborted

Transaction was aborted

§

TransactionCommitted

Transaction has already been committed

§

TransactionClosed

Transaction has been closed

§

IndexNotFound

Index not found

§

IndexAlreadyExists

Index already exists

§

IndexAlreadyExistsByName(String)

Index already exists (with name)

§

IndexNotFoundByName(String)

Index not found (with name)

§

IndexColumnNotFound

Column for index not found

§

IndexClosed

Index is closed

§

EngineNotOpen

Engine is not open

§

EngineAlreadyOpen

Engine is already open

§

ViewAlreadyExists(String)

View already exists

§

ViewNotFound(String)

View not found

§

LockAcquisitionFailed(String)

Failed to acquire lock

§

NoRowsReturned

Query returned no rows

§

NoStatementsToExecute

No statements to execute

§

ColumnIndexOutOfBounds

Column index out of bounds

Fields

§index: usize
§

WalNotRunning

WAL manager is not running

§

WalFileClosed

WAL file is closed

§

WalNotInitialized

WAL not initialized

§

DatabaseLocked

Database is locked by another process

§

CannotDropPrimaryKey

Cannot drop primary key column

§

NullComparison

Cannot compare NULL with non-NULL value

§

IncomparableTypes

Cannot compare incompatible types

§

NotSupported

Operation not supported

§

SegmentNotFound

Segment not found (internal storage error)

§

ExpressionEvaluation

Expression evaluation failed

§

ExpressionEvaluationWithMessage

Expression evaluation failed with message

Fields

§message: String
§

TypeConversion

Type conversion error

Fields

§from: String
§

Parse

Parse error for timestamps or other values

Fields

§message: String
§

Io

IO error (wrapped)

Fields

§message: String
§

Internal

Internal error for unexpected conditions

Fields

§message: String
§

TableExists(String)

Table already exists (with name)

§

TableNotFoundByName(String)

Table not found (with name)

§

TableOrViewNotFound(String)

Table or view not found (with name)

§

ColumnNotFoundNamed(String)

Column not found (with name) - for executor

§

Type(String)

Type error

§

DivisionByZero

Division by zero

§

QueryCancelled

Query cancelled

§

NotSupportedMessage(String)

Operation not supported (with message)

§

ParseError(String)

Parse error (string variant)

§

InvalidArgumentMessage(String)

Invalid argument (string variant)

Implementations§

Source§

impl Error

Source

pub fn table_columns_not_match(expected: usize, got: usize) -> Self

Create a new TableColumnsNotMatch error

Source

pub fn value_too_long(column: impl Into<String>, max: usize, got: usize) -> Self

Create a new ValueTooLong error

Source

pub fn not_null_constraint(column: impl Into<String>) -> Self

Create a new NotNullConstraint error

Source

pub fn primary_key_constraint(row_id: i64) -> Self

Create a new PrimaryKeyConstraint error

Source

pub fn unique_constraint( index: impl Into<String>, column: impl Into<String>, value: impl Into<String>, ) -> Self

Create a new UniqueConstraint error

Source

pub fn column_not_found_by_name(name: impl Into<String>) -> Self

Create a new ColumnNotFoundByName error

Source

pub fn type_conversion(from: impl Into<String>, to: impl Into<String>) -> Self

Create a new TypeConversion error

Source

pub fn parse(message: impl Into<String>) -> Self

Create a new Parse error

Source

pub fn io(message: impl Into<String>) -> Self

Create a new IO error

Source

pub fn internal(message: impl Into<String>) -> Self

Create a new Internal error

Source

pub fn expression_evaluation(message: impl Into<String>) -> Self

Create a new ExpressionEvaluationWithMessage error

Source

pub fn invalid_argument(message: impl Into<String>) -> Self

Create a new InvalidArgument error

Source

pub fn is_not_found(&self) -> bool

Check if this is a “not found” type error

Source

pub fn is_constraint_violation(&self) -> bool

Check if this is a constraint violation error

Source

pub fn is_transaction_error(&self) -> bool

Check if this is a transaction-related error

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

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 Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MvccError> for Error

Source§

fn from(err: MvccError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

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

Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToCompactString for T
where T: Display,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V