#[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
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
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
ResponseFromBinary
Failed to deserialize a binary response
ToJsonString
Failed to serialize sql::Value
to JSON string
FromJsonString
Failed to deserialize from JSON string to sql::Value
InvalidNsName(String)
Invalid namespace name
InvalidDbName(String)
Invalid database name
FileOpen
File open error
FileRead
File read 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
BuildMetadataMismatch
The build metadata of the server is older than the minimum supported by this SDK
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 Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl Error for Error
impl Error for Error
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize
receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize
enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize
struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
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
fn duplicate_field(field: &'static str) -> Self
Deserialize
struct type received more than one of the
same field.Source§impl From<ParseFuncTargetError> for Error
impl From<ParseFuncTargetError> for Error
Source§fn from(source: ParseFuncTargetError) -> Self
fn from(source: ParseFuncTargetError) -> Self
Source§impl From<ParseNetTargetError> for Error
impl From<ParseNetTargetError> for Error
Source§fn from(source: ParseNetTargetError) -> Self
fn from(source: ParseNetTargetError) -> Self
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> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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