Skip to main content

TarantoolResponse

Struct TarantoolResponse 

Source
pub struct TarantoolResponse {
    pub code: u64,
    pub data: Bytes,
    pub sql_metadata: Option<Bytes>,
    pub sql_info: Option<Bytes>,
}
Expand description

Tarantool response struct

use any decode method to decode tarantool response to custom struct by serde please look examples https://github.com/zheludkovm/RustyTarantool/tree/master/examples

Fields§

§code: u64§data: Bytes§sql_metadata: Option<Bytes>§sql_info: Option<Bytes>

Implementations§

Source§

impl TarantoolResponse

Source

pub fn new_short_response(code: u64, data: Bytes) -> TarantoolResponse

Source

pub fn new_full_response( code: u64, data: Bytes, sql_metadata: Option<Bytes>, sql_info: Option<Bytes>, ) -> TarantoolResponse

Source

pub fn decode<'de, T>(self) -> Result<T>
where T: Deserialize<'de>,

decode tarantool response to any serder deserializable struct

Source

pub fn decode_result_set<'de, T>(self) -> Result<Vec<T>>
where T: Deserialize<'de>,

decode tarantool response to any serder deserializable struct

Source

pub fn decode_single<'de, T>(self) -> Result<T>
where T: Deserialize<'de>,

decode tarantool response to tuple wih one element and return this element

Source

pub fn decode_pair<'de, T1, T2>(self) -> Result<(T1, T2)>
where T1: Deserialize<'de>, T2: Deserialize<'de>,

decode tarantool response to tuple of two elements

Source

pub fn decode_trio<'de, T1, T2, T3>(self) -> Result<(T1, T2, T3)>
where T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>,

decode tarantool response to three elements

Trait Implementations§

Source§

impl Debug for TarantoolResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Into<TarantoolSqlResponse> for TarantoolResponse

Source§

fn into(self) -> TarantoolSqlResponse

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

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> 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, 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> Same for T

Source§

type Output = T

Should always be Self
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.