Struct Extension
- Namespace
- Nerdbank.MessagePack
- Assembly
- Nerdbank.MessagePack.dll
Describes a msgpack extension.
public record struct Extension : IEquatable<Extension>
- Implements
- Inherited Members
Constructors
Extension(sbyte, ReadOnlySequence<byte>)
Describes a msgpack extension.
public Extension(sbyte TypeCode, ReadOnlySequence<byte> Data)
Parameters
TypeCode
sbyte- A value that uniquely identifies the extension type. Negative values are reserved for official msgpack extensions. See ReservedMessagePackExtensionTypeCode and LibraryReservedMessagePackExtensionTypeCode for values that are already assigned.
Data
ReadOnlySequence<byte>The data payload, in whatever format is prescribed by the extension as per the
TypeCode
.
Extension(sbyte, ReadOnlyMemory<byte>)
Initializes a new instance of the Extension struct.
public Extension(sbyte typeCode, ReadOnlyMemory<byte> data)
Parameters
typeCode
sbyte- A value that uniquely identifies the extension type. Negative values are reserved for official msgpack extensions. See ReservedMessagePackExtensionTypeCode and LibraryReservedMessagePackExtensionTypeCode for values that are already assigned.
data
ReadOnlyMemory<byte>- The data payload, in whatever format is prescribed by the extension as per the
TypeCode
.
Properties
Data
The data payload, in whatever format is prescribed by the extension as per the TypeCode
.
public ReadOnlySequence<byte> Data { readonly get; set; }
Property Value
Header
Gets the header for the extension that should precede the Data in the msgpack encoded format.
public readonly ExtensionHeader Header { get; }
Property Value
TypeCode
A value that uniquely identifies the extension type. Negative values are reserved for official msgpack extensions. See ReservedMessagePackExtensionTypeCode and LibraryReservedMessagePackExtensionTypeCode for values that are already assigned.
public sbyte TypeCode { readonly get; set; }
Property Value
Methods
Equals(Extension)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(Extension other)
Parameters
other
ExtensionAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.