Skip to content

Class MessagePackRpcSerializer

Namespace: DotBoxD.Codecs.MessagePack
Assembly: DotBoxD.Codecs.MessagePack.dll

MessagePack-based serializer implementation.

public sealed class MessagePackRpcSerializer : ISerializer

objectMessagePackRpcSerializer

ISerializer

object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()

SerializerExtensions.SerializeToPayload<T>(ISerializer, T)

Creates a new MessagePack serializer with default options.

public MessagePackRpcSerializer()

MessagePackRpcSerializer(MessagePackSerializerOptions)

Section titled “ MessagePackRpcSerializer(MessagePackSerializerOptions)”

Creates a new MessagePack serializer with custom options.

public MessagePackRpcSerializer(MessagePackSerializerOptions options)

options MessagePackSerializerOptions

Gets the MessagePack options used for RPC envelopes and method payloads.

public MessagePackSerializerOptions Options { get; }

MessagePackSerializerOptions

CreateOptions(params IFormatterResolver[])

Section titled “ CreateOptions(params IFormatterResolver[])”

Creates MessagePack options that include DotBoxD’s payload formatters before user resolvers.

public static MessagePackSerializerOptions CreateOptions(params IFormatterResolver[] resolvers)

resolvers IFormatterResolver[]

MessagePackSerializerOptions

Creates the legacy contractless serializer preset used by some Unity projects. ContractlessStandardResolver may use reflection and is not an IL2CPP/AOT guarantee; AOT applications should call DotBoxD.Codecs.MessagePack.MessagePackRpcSerializer.CreateWithResolver(MessagePack.IFormatterResolver) with generated formatters.

public static MessagePackRpcSerializer CreateUnityCompatible()

MessagePackRpcSerializer

Creates a serializer using the supplied resolver plus DotBoxD’s binary payload formatters.

public static MessagePackRpcSerializer CreateWithResolver(IFormatterResolver resolver)

resolver IFormatterResolver

MessagePackRpcSerializer

Deserializes a value from a read-only memory region.

public T Deserialize<T>(ReadOnlyMemory<byte> data)

data ReadOnlyMemory<byte>

T

T

Deserializes a value from a read-only memory region to a specified type.

public object? Deserialize(ReadOnlyMemory<byte> data, Type type)

data ReadOnlyMemory<byte>

type Type

object?

Serializes a value into the supplied buffer writer.

public void Serialize<T>(IBufferWriter<byte> writer, T value)

writer IBufferWriter<byte>

value T

T