Table of Contents

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 for values already assigned from the reserved range.

Data ReadOnlySequence<byte>

The data payload, in whatever format is prescribed by the extension as per the TypeCode.

Extension(sbyte, Memory<byte>)

Initializes a new instance of the Extension struct.

public Extension(sbyte typeCode, Memory<byte> data)

Parameters

typeCode sbyte
A value that uniquely identifies the extension type. Negative values are reserved for official msgpack extensions. See ReservedMessagePackExtensionTypeCode for values already assigned from the reserved range.
data Memory<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

ReadOnlySequence<byte>

Header

Gets the header for the extension that should precede the Data in the msgpack encoded format.

public ExtensionHeader Header { get; }

Property Value

ExtensionHeader

TypeCode

A value that uniquely identifies the extension type. Negative values are reserved for official msgpack extensions. See ReservedMessagePackExtensionTypeCode for values already assigned from the reserved range.

public sbyte TypeCode { readonly get; set; }

Property Value

sbyte