pub struct Tuple { /* private fields */ }
Expand description
Represents a set of elements that make up a sortable, typed key.
Tuple
is comparable with other Tuple
s and will sort in
Rust in the same order in which they would sort in FDB. Tuple
s
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
sourceimpl 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.
Trait Implementations
sourceimpl Ord for Tuple
impl Ord for Tuple
sourceimpl PartialOrd<Tuple> for Tuple
impl PartialOrd<Tuple> for Tuple
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Tuple
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more