Enum Api

Source
#[non_exhaustive]
pub enum Api {
Show 54 variants Query(String), Http(String), Ws(String), Scheme(String), ConnectionUninitialised, AlreadyConnected, InvalidBindings(Value), RangeOnRecordId, RangeOnObject, RangeOnArray, RangeOnEdges, RangeOnRange, RangeOnUnspecified, TableColonId { table: String, }, DuplicateRequestId(i64), InvalidRequest(String), InvalidParams(String), InternalError(String), ParseError(String), InvalidSemanticVersion(String), InvalidUrl(String), FromValue { value: Value, error: String, }, ResponseFromBinary { binary: Vec<u8>, error: Error, }, ToJsonString { value: Value, error: String, }, FromJsonString { string: String, error: String, }, InvalidNsName(String), InvalidDbName(String), FileOpen { path: PathBuf, error: Error, }, FileRead { path: PathBuf, error: Error, }, LossyTake(Response), BackupsNotSupported, VersionMismatch { server_version: Version, supported_versions: String, }, BuildMetadataMismatch { server_metadata: BuildMetadata, supported_metadata: BuildMetadata, }, LiveQueriesNotSupported, LiveOnObject, LiveOnArray, LiveOnEdges, LiveOnUnspecified, NotLiveQuery(usize), QueryIndexOutOfBounds(usize), ResponseAlreadyTaken, InsertOnObject, InsertOnArray, InsertOnEdges, InsertOnRange, InsertOnUnspecified, InvalidNetTarget(ParseNetTargetError), InvalidFuncTarget(ParseFuncTargetError), SerializeValue(String), DeSerializeValue(String), Serializer(String), Deserializer(String), RecievedInvalidValue, VersionsNotSupported(String),
}
Expand description

An error originating from a remote SurrealDB database

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

Query(String)

There was an error processing the query

§

Http(String)

There was an error processing a remote HTTP request

§

Ws(String)

There was an error processing a remote WS request

§

Scheme(String)

The specified scheme does not match any supported protocol or storage engine

§

ConnectionUninitialised

Tried to run database queries without initialising the connection first

§

AlreadyConnected

Tried to call connect on an instance already connected

§

InvalidBindings(Value)

Query::bind not called with an object nor a key/value tuple

§

RangeOnRecordId

Tried to use a range query on a record ID

§

RangeOnObject

Tried to use a range query on an object

§

RangeOnArray

Tried to use a range query on an array

§

RangeOnEdges

Tried to use a range query on an edge or edges

§

RangeOnRange

Tried to use a range query on an existing range

§

RangeOnUnspecified

Tried to use a range query on an unspecified resource

§

TableColonId

Tried to use table:id syntax as a method parameter when (table, id) should be used instead

Fields

§table: String
§

DuplicateRequestId(i64)

Duplicate request ID

§

InvalidRequest(String)

Invalid request

§

InvalidParams(String)

Invalid params

§

InternalError(String)

Internal server error

§

ParseError(String)

Parse error

§

InvalidSemanticVersion(String)

Invalid semantic version

§

InvalidUrl(String)

Invalid URL

§

FromValue

Failed to convert a sql::Value to T

Fields

§value: Value
§error: String
§

ResponseFromBinary

Failed to deserialize a binary response

Fields

§binary: Vec<u8>
§error: Error
§

ToJsonString

Failed to serialize sql::Value to JSON string

Fields

§value: Value
§error: String
§

FromJsonString

Failed to deserialize from JSON string to sql::Value

Fields

§string: String
§error: String
§

InvalidNsName(String)

Invalid namespace name

§

InvalidDbName(String)

Invalid database name

§

FileOpen

File open error

Fields

§path: PathBuf
§error: Error
§

FileRead

File read error

Fields

§path: PathBuf
§error: Error
§

LossyTake(Response)

Tried to take only a single result when the query returned multiple records

§

BackupsNotSupported

The protocol or storage engine being used does not support backups on the architecture it’s running on

§

VersionMismatch

The version of the server is not compatible with the versions supported by this SDK

Fields

§server_version: Version
§supported_versions: String
§

BuildMetadataMismatch

The build metadata of the server is older than the minimum supported by this SDK

Fields

§server_metadata: BuildMetadata
§supported_metadata: BuildMetadata
§

LiveQueriesNotSupported

The protocol or storage engine being used does not support live queries on the architecture it’s running on

§

LiveOnObject

Tried to use a range query on an object

§

LiveOnArray

Tried to use a range query on an array

§

LiveOnEdges

Tried to use a range query on an edge or edges

§

LiveOnUnspecified

Tried to use a range query on an unspecified resource

§

NotLiveQuery(usize)

Tried to access a query statement as a live query when it isn’t a live query

§

QueryIndexOutOfBounds(usize)

Tried to access a query statement falling outside the bounds of the statements supplied

§

ResponseAlreadyTaken

Called Response::take or Response::stream on a query response more than once

§

InsertOnObject

Tried to insert on an object

§

InsertOnArray

Tried to insert on an array

§

InsertOnEdges

Tried to insert on an edge or edges

§

InsertOnRange

Tried to insert on an edge or edges

§

InsertOnUnspecified

Tried to insert on an unspecified resource with no data

§

InvalidNetTarget(ParseNetTargetError)

§

InvalidFuncTarget(ParseFuncTargetError)

§

SerializeValue(String)

§

DeSerializeValue(String)

§

Serializer(String)

§

Deserializer(String)

§

RecievedInvalidValue

Tried to convert an value which contained something like for example a query or future.

§

VersionsNotSupported(String)

The engine used does not support data versioning

Trait Implementations§

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

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 Error for Error

Source§

fn custom<T>(msg: T) -> Self
where T: Display,

Used when a Serialize implementation encounters any error while serializing a type. Read more
Source§

impl Error for Error

Source§

fn custom<T>(msg: T) -> Self
where T: Display,

Raised when there is general error when deserializing a type. Read more
Source§

fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a type different from what it was expecting. Read more
Source§

fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a value of the right type but that is wrong for some other reason. Read more
Source§

fn invalid_length(len: usize, exp: &dyn Expected) -> Self

Raised when deserializing a sequence or map and the input data contains too many or too few elements. Read more
Source§

fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize enum type received a variant with an unrecognized name.
Source§

fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize struct type received a field with an unrecognized name.
Source§

fn missing_field(field: &'static str) -> Self

Raised when a Deserialize struct type expected to receive a required field with a particular name but that field was not present in the input.
Source§

fn duplicate_field(field: &'static str) -> Self

Raised when a Deserialize struct type received more than one of the same field.
Source§

impl From<Error> for Error

Source§

fn from(source: Api) -> Self

Converts to this type from the input type.
Source§

impl From<ParseFuncTargetError> for Error

Source§

fn from(source: ParseFuncTargetError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseNetTargetError> for Error

Source§

fn from(source: ParseNetTargetError) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Error

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> AsErrorSource for T
where T: Error + 'static,

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method receivers.
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> 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> 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> ToSmolStr for T
where T: Display + ?Sized,

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<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ParallelSend for T
where T: Send,