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 the value of token, or the default value if token is unset.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

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

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.