FdbValue

Namespace: FoundationDB.Client · class

Factory class for values

Methods

Create

static FdbValue<TValue, TEncoder> Create<TValue, TEncoder>(TValue value)

Returns a value that encodes an instance of TValue with the given encoder

  • value — Value to encode

FromTuple

static FdbVarTupleValue FromTuple(IVarTuple value)

Returns a value that wraps a tuple

static STuple<T1> FromTuple<T1>(in (T1) tuple)

Returns a value that wraps a tuple with a single element

static STuple<T1, T2> FromTuple<T1, T2>(in (T1, T2) tuple)

Returns a value that wraps a tuple with 2 elements

static STuple<T1, T2, T3> FromTuple<T1, T2, T3>(in (T1, T2, T3) tuple)

Returns a value that wraps a tuple with 3 elements

static STuple<T1, T2, T3, T4> FromTuple<T1, T2, T3, T4>(in (T1, T2, T3, T4) tuple)

Returns a value that wraps a tuple with 4 elements

static STuple<T1, T2, T3, T4, T5> FromTuple<T1, T2, T3, T4, T5>(in (T1, T2, T3, T4, T5) tuple)

Returns a value that wraps a tuple with 5 elements

static STuple<T1, T2, T3, T4, T5, T6> FromTuple<T1, T2, T3, T4, T5, T6>(in (T1, T2, T3, T4, T5, T6) tuple)

Returns a value that wraps a tuple with 6 elements

static STuple<T1, T2, T3, T4, T5, T6, T7> FromTuple<T1, T2, T3, T4, T5, T6, T7>(in (T1, T2, T3, T4, T5, T6, T7) tuple)

Returns a value that wraps a tuple with 7 elements

static STuple<T1, T2, T3, T4, T5, T6, T7, T8> FromTuple<T1, T2, T3, T4, T5, T6, T7, T8>(in (T1, T2, T3, T4, T5, T6, T7, (T8)) tuple)

Returns a value that wraps a tuple with 8 elements

ToBytes

static FdbRawValue ToBytes(Slice value)

Returns a value that wraps a Slice

static FdbRawValue ToBytes(byte[] value)

Returns a value that wraps a byte array

static FdbRawMemoryValue ToBytes(ReadOnlyMemory<byte> value)

Returns a value that wraps a memory region

static FdbRawSpanValue ToBytes(ReadOnlySpan<byte> value)

Returns a value that wraps a span of bytes

static FdbValue<MemoryStream, RawEncoder> ToBytes(MemoryStream value)

Returns a value that wraps the content of a MemoryStream

The stream will be written from the start, and NOT the current position.

static FdbRawValue ToBytes(byte[] value, int start, int length)

Returns a value that wraps a byte array

ToCompactBigEndian

static FdbCompactBigEndianUInt32Value ToCompactBigEndian(int value)

Returns a value that wraps an integer, encoded in big endian, using as few bytes as possible

Ex: 0x1234 will be encoded as 12 34

static FdbCompactBigEndianUInt32Value ToCompactBigEndian(uint value)

Returns a value that wraps an integer, encoded in big endian, using as few bytes as possible

Ex: 0x1234 will be encoded as 12 34

static FdbCompactBigEndianUInt64Value ToCompactBigEndian(long value)

Returns a value that wraps an integer, encoded in big endian, using as few bytes as possible

Ex: 0x1234 will be encoded as 12 34

static FdbCompactBigEndianUInt64Value ToCompactBigEndian(ulong value)

Returns a value that wraps an integer, encoded in big endian, using as few bytes as possible

Ex: 0x1234 will be encoded as 12 34

ToCompactLittleEndian

static FdbCompactLittleEndianUInt32Value ToCompactLittleEndian(int value)

Returns a value that wraps a signed 32-bit integer, encoded as little endian using as few bytes as possible

Ex: 0x1234 will be encoded as 34 12

static FdbCompactLittleEndianUInt32Value ToCompactLittleEndian(uint value)

Returns a value that wraps an unsigned 32-bit integer, encoded as little endian using as few bytes as possible

Ex: 0x1234 will be encoded as 34 12

static FdbCompactLittleEndianUInt64Value ToCompactLittleEndian(long value)

Returns a value that wraps a signed 64-bit integer, encoded as little endian using as few bytes as possible

Ex: 0x1234 will be encoded as 34 12

static FdbCompactLittleEndianUInt64Value ToCompactLittleEndian(ulong value)

Returns a value that wraps an unsigned 64-bit integer, encoded as little endian using as few bytes as possible

Ex: 0x1234 will be encoded as 34 12

ToFixed32BigEndian

static FdbBigEndianUInt32Value ToFixed32BigEndian(int value)

Returns a value that wraps a fixed-size signed 32-bit integer, encoded as 4 bytes in big-endian

Ex: 0x1234 will be encoded as 34 12 00 00

static FdbBigEndianUInt32Value ToFixed32BigEndian(uint value)

Returns a value that wraps a fixed-size unsigned 32-bit integer, encoded as 4 bytes in big-endian

Ex: 0x1234 will be encoded as 34 12 00 00

ToFixed32LittleEndian

static FdbLittleEndianUInt32Value ToFixed32LittleEndian(int value)

Returns a value that wraps a fixed-size signed 32-bit integer, encoded as 4 bytes in little-endian

Ex: 0x1234 will be encoded as 00 00 12 34

static FdbLittleEndianUInt32Value ToFixed32LittleEndian(uint value)

Returns a value that wraps a fixed-size unsigned 32-bit integer, encoded as 4 bytes in little-endian

Ex: 0x1234 will be encoded as 00 00 12 34

ToFixed64BigEndian

static FdbBigEndianUInt64Value ToFixed64BigEndian(long value)

Returns a value that wraps a fixed-size signed 64-bit integer, encoded as 8 bytes in big-endian

Ex: 0x1234 will be encoded as 34 12 00 00 00 00 00 00

static FdbBigEndianUInt64Value ToFixed64BigEndian(ulong value)

Returns a value that wraps a fixed-size unsigned 64-bit integer, encoded as 8 bytes in big-endian

Ex: 0x1234 will be encoded as 34 12 00 00 00 00 00 00

ToFixed64LittleEndian

static FdbLittleEndianUInt64Value ToFixed64LittleEndian(long value)

Returns a value that wraps a fixed-size signed 64-bit integer, encoded as 8 bytes in little-endian

Ex: 0x1234 will be encoded as 00 00 00 00 00 00 12 34

static FdbLittleEndianUInt64Value ToFixed64LittleEndian(ulong value)

Returns a value that wraps a fixed-size unsigned 64-bit integer, encoded as 8 bytes in little-endian

Ex: 0x1234 will be encoded as 00 00 00 00 00 00 12 34

ToJson

static FdbJsonValue ToJson(JsonValue value, CrystalJsonSettings settings = null)

Returns a value that wraps a JsonValue, encoded as UTF-8 bytes

static FdbJsonValue<T> ToJson<T>(T value, IJsonSerializer<T> serializer = null, CrystalJsonSettings settings = null)

ToTextUtf16

static FdbUtf16Value ToTextUtf16(string value)

Returns a value that wraps a string, encoded as UTF-16 bytes

static FdbValue<StringBuilder, Utf16Encoder> ToTextUtf16(StringBuilder value)

Returns a value that wraps a StringBuilder, encoded as UTF-16 bytes

static FdbUtf16Value ToTextUtf16(char[] value)

Returns a value that wraps a char array, encoded as UTF-16 bytes

static FdbUtf16Value ToTextUtf16(ReadOnlyMemory<char> value)

Returns a value that wraps a span of char, encoded as UTF-16 bytes

static FdbUtf16SpanValue ToTextUtf16(ReadOnlySpan<char> value)

Returns a value that wraps a span of char, encoded as UTF-16 bytes

static FdbUtf16Value ToTextUtf16(char[] value, int start, int length)

Returns a value that wraps a segment of a char array, encoded as UTF-16 bytes

ToTextUtf8

static FdbUtf8Value ToTextUtf8(string value)

Returns a value that wraps a string, encoded as UTF-8 bytes

static FdbValue<StringBuilder, Utf8Encoder> ToTextUtf8(StringBuilder value)

Returns a value that wraps a StringBuilder, encoded as UTF-8 bytes

static FdbUtf8Value ToTextUtf8(char[] value)

Returns a value that wraps a char array, encoded as UTF-8 bytes

static FdbUtf8Value ToTextUtf8(ReadOnlyMemory<char> value)

Returns a value that wraps a span of char, encoded as UTF-8 bytes

static FdbUtf8SpanValue ToTextUtf8(ReadOnlySpan<char> value)

Returns a value that wraps a span of char, encoded as UTF-8 bytes

static FdbUtf8Value ToTextUtf8(char[] value, int start, int length)

Returns a value that wraps a segment of a char array, encoded as UTF-8 bytes

ToTuple

static STuple<T1> ToTuple<T1>(T1 item1)

Returns a value that encodes as a tuple with a single element

static STuple<T1, T2> ToTuple<T1, T2>(T1 item1, T2 item2)

Returns a value that encodes as a tuple with 2 elements

static STuple<T1, T2, T3> ToTuple<T1, T2, T3>(T1 item1, T2 item2, T3 item3)

Returns a value that encodes as a tuple with 3 elements

static STuple<T1, T2, T3, T4> ToTuple<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)

Returns a value that encodes as a tuple with 4 elements

static STuple<T1, T2, T3, T4, T5> ToTuple<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)

Returns a value that encodes as a tuple with 5 elements

static STuple<T1, T2, T3, T4, T5, T6> ToTuple<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)

Returns a value that encodes as a tuple with 6 elements

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

Returns a value that encodes as a tuple with 7 elements

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

Returns a value that encodes as a tuple with 8 elements

ToUuid128

static FdbValue<Guid, FixedSizeUuidEncoder> ToUuid128(Guid value)

Returns a value that wraps a 128-bit UUID, encoded as 16 bytes

Fields

Empty

static readonly Slice Empty

MaxSize

const int MaxSize

MaxValue32

static readonly FdbLittleEndianUInt32Value MaxValue32

Four 0xFF bytes (`FF FF FF FF`)

MaxValue64

static readonly FdbLittleEndianUInt64Value MaxValue64

Eight 0xFF bytes (`FF FF FF FF FF FF FF FF`)

Zero32

static readonly FdbLittleEndianUInt32Value Zero32

Four 0x00 bytes (`00 00 00 00`)

Zero64

static readonly FdbLittleEndianUInt64Value Zero64

Eight 0x00 bytes (`00 00 00 00 00 00 00 00`)