FdbRawValue
Namespace: FoundationDB.Client · struct
Implements: IFdbValue, ISpanEncodable, ISpanFormattable, IFormattable, IEquatable<FdbRawValue>, IEquatable<IFdbValue>, IEquatable<Slice>, IEquatable<ReadOnlySpan<byte>>
Value that wraps raw bytes
Properties
Span
ReadOnlySpan<byte> Span { get; }
Methods
Equals
bool Equals(object obj)
bool Equals(IFdbValue other)
bool Equals(FdbRawValue other)
bool Equals(Slice other)
bool Equals(ReadOnlySpan<byte> other)
GetHashCode
int GetHashCode()
GetTypeHint
FdbValueTypeHint GetTypeHint()
Returns a hint on how to interpret this value
ToString
string ToString()
string ToString(string format, IFormatProvider formatProvider)
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
Data
readonly Slice Data
Wrapped bytes
Empty
static readonly FdbRawValue Empty
Value that is equivalent to the Empty slice.
Nil
static readonly FdbRawValue Nil
Value that is equivalent to the Nil slice.
This can be used to represent a missing value, or a "Not Found" result.
TypeHint
readonly FdbValueTypeHint TypeHint
Hint about the type of the wrapped data