[][src]Struct tarantool_module::tuple::KeyDef

pub struct KeyDef { /* fields omitted */ }

Implementations

impl KeyDef[src]

pub fn new(items: Vec<KeyDefItem>) -> Self[src]

Create key definition with key fields with passed typed on passed positions. May be used for tuple format creation and/or tuple comparison.

  • items - array with key field identifiers and key field types (see FieldType)

pub fn compare(&self, tuple_a: &Tuple, tuple_b: &Tuple) -> Ordering[src]

Compare tuples using the key definition.

  • tuple_a - first tuple
  • tuple_b - second tuple

Returns:

  • Ordering::Equal if key_fields(tuple_a) == key_fields(tuple_b)
  • Ordering::Less if key_fields(tuple_a) < key_fields(tuple_b)
  • Ordering::Greater if key_fields(tuple_a) > key_fields(tuple_b)

pub fn compare_with_key<K>(&self, tuple: &Tuple, key: &K) -> Ordering where
    K: AsTuple
[src]

Compare tuple with key using the key definition.

  • tuple - tuple
  • key - key with MessagePack array header

Returns:

  • Ordering::Equal if key_fields(tuple) == parts(key)
  • Ordering::Less if key_fields(tuple) < parts(key)
  • Ordering::Greater if key_fields(tuple) > parts(key)

Trait Implementations

impl Drop for KeyDef[src]

Auto Trait Implementations

impl RefUnwindSafe for KeyDef

impl !Send for KeyDef

impl !Sync for KeyDef

impl Unpin for KeyDef

impl UnwindSafe for KeyDef

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> From<T> for T[src]

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

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.