FdbTupleKey
Namespace: FoundationDB.Client · struct
Implements: IFdbKey, ISpanEncodable, ISpanFormattable, IFormattable, IEquatable<FdbRawKey>, IComparable<FdbRawKey>, IEquatable<Slice>, IComparable<Slice>, IEquatable<IFdbKey>, IComparable, IEquatable<ReadOnlySpan<byte>>, IComparable<ReadOnlySpan<byte>>, IEquatable<FdbTupleKey>, IComparable<FdbTupleKey>, IComparisonOperators<FdbTupleKey, FdbTupleKey, bool>, IEqualityOperators<FdbTupleKey, FdbTupleKey, bool>, IComparisonOperators<FdbTupleKey, FdbRawKey, bool>, IEqualityOperators<FdbTupleKey, FdbRawKey, bool>, IComparisonOperators<FdbTupleKey, Slice, bool>, IEqualityOperators<FdbTupleKey, Slice, bool>
Key that is composed of a tuple inside a subspace
Remarks
Encoded as the subspace's prefix, following by the packed tuple items
Constructors
FdbTupleKey
FdbTupleKey(IKeySubspace subspace, IVarTuple items)
Methods
Append
FdbTupleKey Append<T1>(T1 item1)
Appends an element to the key
FdbTupleKey Append<T1, T2>(T1 item1, T2 item2)
Appends two elements to the key
FdbTupleKey Append<T1, T2, T3>(T1 item1, T2 item2, T3 item3)
Appends three elements to the key
FdbTupleKey Append<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)
Appends four elements to the key
FdbTupleKey Append<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)
Appends five elements to the key
FdbTupleKey Append<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)
Appends six elements to the key
FdbTupleKey Append<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)
Appends seven elements to the key
FdbTupleKey Append<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8)
Appends eight elements to the key
CompareTo
int CompareTo(object obj)
int CompareTo(FdbTupleKey other)
int CompareTo(FdbRawKey other)
int CompareTo(Slice other)
int CompareTo(ReadOnlySpan<byte> other)
Contains
bool Contains(ReadOnlySpan<byte> key)
Tests if this key is a prefix of the given key
key— Key being tested
Returns: true if key starts with the same bytes as the current key; otherwise, false
The key foobar is contained inside foo because it starts with foo, but bar is NOT contained inside foo because it does not have the same prefix.
Any key contains "itself", so foo is contained inside foo
bool Contains<TOtherKey>(in TOtherKey key)
Tests if this key is a prefix of the given key
key— Key being tested
Returns: true if key starts with the same bytes as the current key; otherwise, false
The key foobar is contained inside foo because it starts with foo, but bar is NOT contained inside foo because it does not have the same prefix.
Any key contains "itself", so foo is contained inside foo
Equals
bool Equals(object other)
bool Equals(IFdbKey other)
bool Equals(FdbTupleKey other)
bool Equals(FdbRawKey other)
bool Equals(Slice other)
bool Equals(ReadOnlySpan<byte> other)
FastCompareTo
int FastCompareTo<TOtherKey>(in TOtherKey other)
FastEqualTo
bool FastEqualTo<TOtherKey>(in TOtherKey other)
GetHashCode
int GetHashCode()
ToString
string ToString()
string ToString(string format, IFormatProvider formatProvider = null)
TryEncode
bool TryEncode(Span<byte> destination, out int bytesWritten)
Encodes this instance into its equivalent binary representation in the database
destination— Destination bufferbytesWritten— Number of bytes written to the buffer
Returns: true if the operation was successful and the buffer was large enough, or false if it was too small
TryFormat
bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider)
TryGetSizeHint
bool TryGetSizeHint(out int sizeHint)
Returns a quick estimate of the initial buffer size that would be large enough to encode this instance, in a single call to TryEncode
sizeHint— Receives an initial capacity that will satisfy almost all values. There is no guarantees that the size will be exact, and the estimate may be smaller or larger than the actual encoded size.
Returns: true if a size could be quickly computed; otherwise, false
TryGetSpan
bool TryGetSpan(out ReadOnlySpan<byte> span)
Returns the already encoded binary representation of the instance, if already available.
span— Points to the in-memory binary representation of the encoded key
Returns: true if the key has already been encoded, or it its in-memory layout is the same; otherwise, false
This is only intended to support pass-through or already encoded keys (via Slice), or when the binary representation has been cached to allow multiple uses.
Fields
Items
readonly IVarTuple Items
Subspace
readonly IKeySubspace Subspace