Struct ql2::Response [−][src]
pub struct Response {
pub type: Option<i32>,
pub error_type: Option<i32>,
pub notes: Vec<i32>,
pub token: Option<i64>,
pub response: Vec<Datum>,
pub backtrace: Option<Backtrace>,
pub profile: Option<Datum>,
}
Expand description
You get back a response with the same [token] as your query.
Fields
type: Option<i32>
error_type: Option<i32>
notes: Vec<i32>
token: Option<i64>
Indicates what [Query] this response corresponds to.
response: Vec<Datum>
[response] contains 1 RQL datum if [type] is [SUCCESS_ATOM] or [SERVER_INFO]. [response] contains many RQL data if [type] is [SUCCESS_SEQUENCE] or [SUCCESS_PARTIAL]. [response] contains 1 error message (of type [R_STR]) in all other cases.
backtrace: Option<Backtrace>
If [type] is [CLIENT_ERROR], [TYPE_ERROR], or [RUNTIME_ERROR], then a backtrace will be provided. The backtrace says where in the query the error occurred. Ideally this information will be presented to the user as a pretty-printed version of their query with the erroneous section underlined. A backtrace is a series of 0 or more [Frame]s, each of which specifies either the index of a positional argument or the name of an optional argument. (Those words will make more sense if you look at the [Term] message below.)
Contains n [Frame]s when you get back an error.
profile: Option<Datum>
If the [global_optargs] in the [Query] that this [Response] is a response to contains a key “profile” which maps to a static value of true then [profile] will contain a [Datum] which provides profiling information about the execution of the query. This field should be returned to the user along with the result that would normally be returned (a datum or a cursor). In official drivers this is accomplished by putting them inside of an object with “value” mapping to the return value and “profile” mapping to the profile object.
Implementations
Returns the enum value of type
, or the default if the field is unset or set to an invalid enum value.
Sets type
to the provided enum value.
Returns an iterator which yields the valid enum values contained in notes
.
Appends the provided enum value to notes
.
Returns the enum value of error_type
, or the default if the field is unset or set to an invalid enum value.
Sets error_type
to the provided enum value.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Response
impl UnwindSafe for Response
Blanket Implementations
Mutably borrows from an owned value. Read more