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§
Source§impl Tuple
impl Tuple
Sourcepub fn add_string(&mut self, s: String)
pub fn add_string(&mut self, s: String)
Sourcepub fn add_bigint(&mut self, i: BigInt)
pub fn add_bigint(&mut self, i: BigInt)
Sourcepub fn add_versionstamp(&mut self, v: Versionstamp)
pub fn add_versionstamp(&mut self, v: Versionstamp)
Append Versionstamp value to the Tuple
Sourcepub fn has_incomplete_versionstamp(&self) -> bool
pub fn has_incomplete_versionstamp(&self) -> bool
Determines if there is a Versionstamp included in this
Tuple that has not had its transaction version set.
Sourcepub fn get_null(&self, index: usize) -> FdbResult<()>
pub fn get_null(&self, index: usize) -> FdbResult<()>
Gets an indexed item as FDB Tuple null value.
Sourcepub fn get_bytes_ref(&self, index: usize) -> FdbResult<&Bytes>
pub fn get_bytes_ref(&self, index: usize) -> FdbResult<&Bytes>
Gets an indexed item as Bytes ref.
Sourcepub fn get_string_ref(&self, index: usize) -> FdbResult<&String>
pub fn get_string_ref(&self, index: usize) -> FdbResult<&String>
Gets an indexed item as String ref.
Sourcepub fn get_tuple_ref(&self, index: usize) -> FdbResult<&Tuple>
pub fn get_tuple_ref(&self, index: usize) -> FdbResult<&Tuple>
Gets an indexed item as Tuple ref.
Sourcepub fn get_versionstamp_ref(&self, index: usize) -> FdbResult<&Versionstamp>
pub fn get_versionstamp_ref(&self, index: usize) -> FdbResult<&Versionstamp>
Gets an indexed item as Versionstamp ref.
Sourcepub fn pack_with_versionstamp(&self, prefix: Bytes) -> FdbResult<Bytes>
pub fn pack_with_versionstamp(&self, prefix: Bytes) -> FdbResult<Bytes>
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.