[−][src]Struct tarantool_module::tuple::Tuple
Tuple
Implementations
impl Tuple
[src]
pub fn from_struct<T>(value: &T) -> Result<Self, Error> where
T: AsTuple,
[src]
T: AsTuple,
Creates new tuple from value
.
This function will serialize structure instance value
of type T
into tuple internal representation
See also: AsTuple
pub fn len(&self) -> u32
[src]
Return the number of fields in tuple (the size of MsgPack Array).
pub fn bsize(&self) -> usize
[src]
Will return the number of bytes in the tuple.
With both the memtx storage engine and the vinyl storage engine the default maximum is one megabyte
(memtx_max_tuple_size
or vinyl_max_tuple_size
). Every field has one or more "length" bytes preceding the
actual contents, so bsize()
returns a value which is slightly greater than the sum of the lengths of the
contents.
The value does not include the size of "struct tuple" (for the current size of this structure look in the tuple.h file in Tarantool’s source code).
pub fn format(&self) -> TupleFormat
[src]
Return the associated format.
pub fn iter(&self) -> Result<TupleIterator, Error>
[src]
Allocate and initialize a new Tuple
iterator. The Tuple
iterator
allow to iterate over fields at root level of MsgPack array.
Example:
let mut it = tuple.iter().unwrap(); while let Some(field) = it.next().unwrap() { // process data } // rewind iterator to first position it.rewind(); assert!(it.position() == 0); // rewind iterator to first position field = it.seek(3).unwrap(); assert!(it.position() == 4);
pub fn field<T>(&self, fieldno: u32) -> Result<Option<T>, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
Return the raw Tuple field in MsgPack format.
The buffer is valid until next call to box_tuple_* functions.
fieldno
- zero-based index in MsgPack array.
Returns:
None
ifi >= box_tuple_field_count(Tuple)
or if field has a non primitive type- field value otherwise
pub fn into_struct<T>(self) -> Result<T, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
Deserializes tuple contents into structure of type T
Trait Implementations
impl Clone for Tuple
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for Tuple
[src]
impl Into<Tuple> for FunctionArgs
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tuple
impl !Send for Tuple
impl !Sync for Tuple
impl Unpin for Tuple
impl UnwindSafe for Tuple
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,