#[repr(C)]
pub struct FunctionCtx { /* private fields */ }
Expand description

FunctionCtx

Implementations§

source§

impl FunctionCtx

source

pub fn return_tuple(&self, tuple: &Tuple) -> Result<c_int>

Return a Tuple from stored procedure.

Returned Tuple is automatically reference counted by Tarantool.

  • tuple - a Tuple to return
source

pub fn return_mp<T>(&self, value: &T) -> Result<c_int>where T: Serialize + ?Sized,

Return a value encoded as MessagePack from a stored procedure.

MessagePack is not validated, for the sake of speed. It is expected to be a single encoded object. An attempt to encode and return multiple objects without wrapping them into an MP_ARRAY or MP_MAP is undefined behaviour.

  • value - value to be encoded to MessagePack
source

pub fn return_bytes(&self, bytes: &[u8]) -> Result<c_int>

Return raw bytes representing a MessagePack value from a stored procedure.

MessagePack is not validated, for the sake of speed. It is expected to be a single encoded object. An attempt to encode and return multiple objects without wrapping them into an MP_ARRAY or MP_MAP is undefined behaviour.

  • bytes - raw msgpack bytes to be returned

Trait Implementations§

source§

impl Debug for FunctionCtx

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.