Skip to main content

YugenDbError

Enum YugenDbError 

Source
pub enum YugenDbError {
Show 15 variants NotFound { message: String, }, ConnectionError { message: String, }, SerialisationError { message: String, }, DeserialisationError { message: String, }, Timeout { message: String, }, Conflict { message: String, }, TransactionAborted { message: String, }, UnsupportedFeature { feature: String, message: String, }, ConstraintViolation { message: String, }, InvalidKey { message: String, }, InvalidNamespace { message: String, }, InvalidCollection { message: String, }, InvalidValue { message: String, }, DriverError { driver: String, message: String, }, InternalError { message: String, },
}
Expand description

Main structured error type for yugendb.

Variants§

§

NotFound

A requested record was not found when the operation required it.

Fields

§message: String
§

ConnectionError

A backend connection could not be opened or used.

Fields

§message: String
§

SerialisationError

A value could not be serialised.

Fields

§message: String
§

DeserialisationError

Stored bytes could not be deserialised into the requested type.

Fields

§message: String
§

Timeout

An operation exceeded its allowed time.

Fields

§message: String
§

Conflict

An operation conflicted with existing data or concurrent work.

Fields

§message: String
§

TransactionAborted

A transaction was aborted.

Fields

§message: String
§

UnsupportedFeature

The selected driver does not support the requested feature.

Fields

§feature: String
§message: String
§

ConstraintViolation

A storage constraint was violated.

Fields

§message: String
§

InvalidKey

A key was invalid.

Fields

§message: String
§

InvalidNamespace

A namespace was invalid.

Fields

§message: String
§

InvalidCollection

A collection name was invalid.

Fields

§message: String
§

InvalidValue

A value was invalid.

Fields

§message: String
§

DriverError

A driver reported a backend-specific failure.

Fields

§driver: String
§message: String
§

InternalError

A yugendb invariant failed.

Fields

§message: String

Implementations§

Source§

impl YugenDbError

Source

pub const fn code(&self) -> ErrorCode

Returns the stable cross-language error code.

Source

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

Creates a not found error.

Source

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

Creates a connection error.

Source

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

Creates a serialisation error.

Source

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

Creates a deserialisation error.

Source

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

Creates a timeout error.

Source

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

Creates a conflict error.

Source

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

Creates a transaction aborted error.

Source

pub fn unsupported_feature( feature: impl Into<String>, message: impl Into<String>, ) -> Self

Creates an unsupported feature error.

Source

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

Creates a constraint violation error.

Source

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

Creates an invalid key error.

Source

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

Creates an invalid namespace error.

Source

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

Creates an invalid collection error.

Source

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

Creates an invalid value error.

Source

pub fn driver_error( driver: impl Into<String>, message: impl Into<String>, ) -> Self

Creates a driver error.

Source

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

Creates an invariant error.

Trait Implementations§

Source§

impl Debug for YugenDbError

Source§

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

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

impl Display for YugenDbError

Source§

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

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

impl Error for YugenDbError

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<Infallible> for YugenDbError

Source§

fn from(error: Infallible) -> Self

Converts to this type from the input type.

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