Struct fdb::tuple::Tuple

source · []
pub struct Tuple { /* private fields */ }
Expand description

Represents a set of elements that make up a sortable, typed key.

Tuple is comparable with other Tuples and will sort in Rust in the same order in which they would sort in FDB. Tuples sort first by the first element, then by the second, etc., This make tuple layer ideal for building a variety of higher-level data models.

For general guidance on tuple usage, see this link.

Tuple can contain null, Bytes, String, another Tuple, BigInt, i64, i32, i16, i8, f32, f64, bool, Uuid, Versionstamp values.

Implementations

Create a new empty Tuple.

Construct a new Tuple with elements decoded from a supplied Bytes.

Append FDB Tuple null value to Tuple.

Append Bytes value to the Tuple.

Append String value to the Tuple.

Append Tuple value to the Tuple

Append BigInt value to the Tuple

Panic

Panics if the Bytes encoded length of the BigInt is greater than 255.

Append i64 value to the Tuple

Append i32 value to the Tuple

Append i16 value to the Tuple.

Append i8 value to the Tuple.

Append f32 value to the Tuple.

Note

The f32 value is encoded using type code 0x20, without any conversion.

Append f64 value to the Tuple.

Note

The f64 value is encoded using type code 0x21, without any conversion.

Append bool value to the Tuple.

Append Uuid value to the Tuple.

Append Versionstamp value to the Tuple

Append elements of Tuple t to Tuple Self

Determines if there is a Versionstamp included in this Tuple that has not had its transaction version set.

Gets an indexed item as FDB Tuple null value.

Gets an indexed item as Bytes ref.

Gets an indexed item as String ref.

Gets an indexed item as Tuple ref.

Gets an indexed item as BigInt.

Gets an indexed item as i64.

Gets an indexed item as i32.

Gets an indexed item as i16.

Gets an indexed item as i8.

Gets an indexed item as f32.

Gets an indexed item as f64.

Gets an indexed item as bool.

Gets an indexed item as Uuid ref.

Gets an indexed item as Versionstamp ref.

Determine if this Tuple contains no elements.

Gets the number of elements in this Tuple.

Get an encoded representation of this Tuple.

Get an encoded representation of this Tuple for use with SetVersionstampedKey.

Panic

The index where incomplete versionstamp is located is a 32-bit little-endian integer. If the generated index overflows u32, then this function panics.

Returns a range representing all keys that encode Tuples strictly starting with this Tuple.

Panic

Panics if the tuple contains an incomplete Versionstamp.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.