Skip to main content

SurqlError

Enum SurqlError 

Source
pub enum SurqlError {
Show 20 variants Database { reason: String, }, Connection { reason: String, }, Query { reason: String, }, Transaction { reason: String, }, Context { reason: String, }, Registry { reason: String, }, Streaming { reason: String, }, Validation { reason: String, }, SchemaParse { reason: String, }, MigrationDiscovery { reason: String, }, MigrationLoad { reason: String, }, MigrationGeneration { reason: String, }, MigrationExecution { reason: String, }, MigrationHistory { reason: String, }, MigrationSquash { reason: String, }, MigrationWatcher { reason: String, }, Orchestration { reason: String, }, Serialization { reason: String, }, Io { reason: String, }, WithContext { source: Box<SurqlError>, context: String, },
}
Expand description

Unified error type for the surql crate.

Each variant corresponds to one subsystem. Variants can be wrapped with additional context via Context::context.

Variants§

§

Database

General database error (analogue of Python DatabaseError).

Fields

§reason: String

Human-readable explanation.

§

Connection

Connection failed, timed out, or was closed unexpectedly.

Fields

§reason: String

Human-readable explanation.

§

Query

A query failed at the database or during result decoding.

Fields

§reason: String

Human-readable explanation.

§

Transaction

A transaction could not be started, committed, or rolled back.

Fields

§reason: String

Human-readable explanation.

§

Context

Ambient connection context was missing or misconfigured.

Fields

§reason: String

Human-readable explanation.

§

Registry

Named-connection registry lookup or registration failed.

Fields

§reason: String

Human-readable explanation.

§

Streaming

Live/streaming query error.

Fields

§reason: String

Human-readable explanation.

§

Validation

Input failed validation (invalid identifier, malformed id, etc.).

Fields

§reason: String

Human-readable explanation.

§

SchemaParse

Schema parser could not understand the schema text or response.

Fields

§reason: String

Human-readable explanation.

§

MigrationDiscovery

Error while discovering migration files on disk.

Fields

§reason: String

Human-readable explanation.

§

MigrationLoad

Error while loading an individual migration.

Fields

§reason: String

Human-readable explanation.

§

MigrationGeneration

Error while generating a migration from a schema diff.

Fields

§reason: String

Human-readable explanation.

§

MigrationExecution

Error while executing a migration against the database.

Fields

§reason: String

Human-readable explanation.

§

MigrationHistory

Error while reading or writing migration history.

Fields

§reason: String

Human-readable explanation.

§

MigrationSquash

Error while squashing migrations.

Fields

§reason: String

Human-readable explanation.

§

MigrationWatcher

Error raised by the schema file watcher.

Fields

§reason: String

Human-readable explanation.

§

Orchestration

Multi-environment orchestration failed.

Fields

§reason: String

Human-readable explanation.

§

Serialization

JSON encode or decode failure.

Fields

§reason: String

Human-readable explanation.

§

Io

Filesystem / generic I/O error.

Fields

§reason: String

Human-readable explanation.

§

WithContext

An existing SurqlError with extra context prepended.

Fields

§source: Box<SurqlError>

Underlying error.

§context: String

Context description added at the call site.

Trait Implementations§

Source§

impl Clone for SurqlError

Source§

fn clone(&self) -> SurqlError

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 SurqlError

Source§

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

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

impl Display for SurqlError

Source§

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

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

impl Error for SurqlError

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 SurqlError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SurqlError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SurqlError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SurqlError

Source§

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

Source§

impl StructuralPartialEq for SurqlError

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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

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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool