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 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

ReadOnlySequence<byte>

Header

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

public readonly 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 and LibraryReservedMessagePackExtensionTypeCode for values that are already assigned.
public sbyte TypeCode { readonly get; set; }

Property Value

sbyte

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 Extension

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

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.