FdbSuffixKey

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<FdbSuffixKey>, IComparable<FdbSuffixKey>

Wraps a Slice that wraps a pre-encoded binary suffix, relative to a subspace

Methods

CompareTo

int CompareTo(object obj)

int CompareTo(FdbSuffixKey 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(FdbSuffixKey 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()

Key

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1>> Key<T1>(T1 item1)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2>> Key<T1, T2>(T1 item1, T2 item2)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3>> Key<T1, T2, T3>(T1 item1, T2 item2, T3 item3)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3, T4>> Key<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3, T4, T5>> Key<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3, T4, T5, T6>> Key<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3, T4, T5, T6, T7>> Key<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)

FdbTupleSuffixKey<FdbSuffixKey, STuple<T1, T2, T3, T4, T5, T6, T7, T8>> Key<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8)

ToSlice

Slice ToSlice()

Encodes this key into Slice

Returns: Slice that contains the binary representation of this key

SliceOwner ToSlice(ArrayPool<byte> pool)

Encodes this key into Slice, using backing buffer rented from a pool

  • pool — Pool used to rent the buffer (Shared is null)

Returns: SliceOwner that contains the binary representation of this key

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 buffer
  • bytesWritten — 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

Subspace

readonly IKeySubspace Subspace

Parent subspace

Suffix

readonly Slice Suffix

Suffix added after the parent's prefix