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>,
}

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 Frames, 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 Frames 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

impl Response[src]

pub fn type(&self) -> ResponseType[src]

Returns the enum value of type, or the default if the field is unset or set to an invalid enum value.

pub fn set_type(&mut self, value: ResponseType)[src]

Sets type to the provided enum value.

pub fn token(&self) -> i64[src]

Returns the value of token, or the default value if token is unset.

pub fn notes(
    &self
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<ResponseNote>>
[src]

Returns an iterator which yields the valid enum values contained in notes.

pub fn push_notes(&mut self, value: ResponseNote)[src]

Appends the provided enum value to notes.

pub fn error_type(&self) -> ErrorType[src]

Returns the enum value of error_type, or the default if the field is unset or set to an invalid enum value.

pub fn set_error_type(&mut self, value: ErrorType)[src]

Sets error_type to the provided enum value.

Trait Implementations

impl Clone for Response[src]

impl Debug for Response[src]

impl Default for Response[src]

impl<'de> Deserialize<'de> for Response[src]

impl Message for Response[src]

impl PartialEq<Response> for Response[src]

impl Serialize for Response[src]

impl StructuralPartialEq for Response[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.