Class MessagePackRpcSerializer
Namespace: DotBoxD.Codecs.MessagePack
Assembly: DotBoxD.Codecs.MessagePack.dll
MessagePack-based serializer implementation.
public sealed class MessagePackRpcSerializer : ISerializerInheritance
Section titled “Inheritance”object ← MessagePackRpcSerializer
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()
Extension Methods
Section titled “Extension Methods”SerializerExtensions.SerializeToPayload<T>(ISerializer, T)
Constructors
Section titled “Constructors”MessagePackRpcSerializer()
Section titled “ MessagePackRpcSerializer()”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)Parameters
Section titled “Parameters”options MessagePackSerializerOptions
Properties
Section titled “Properties”Options
Section titled “ Options”Gets the MessagePack options used for RPC envelopes and method payloads.
public MessagePackSerializerOptions Options { get; }Property Value
Section titled “Property Value”MessagePackSerializerOptions
Methods
Section titled “Methods”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)Parameters
Section titled “Parameters”resolvers IFormatterResolver[]
Returns
Section titled “Returns”MessagePackSerializerOptions
CreateUnityCompatible()
Section titled “ CreateUnityCompatible()”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()Returns
Section titled “Returns”CreateWithResolver(IFormatterResolver)
Section titled “ CreateWithResolver(IFormatterResolver)”Creates a serializer using the supplied resolver plus DotBoxD’s binary payload formatters.
public static MessagePackRpcSerializer CreateWithResolver(IFormatterResolver resolver)Parameters
Section titled “Parameters”resolver IFormatterResolver
Returns
Section titled “Returns”Deserialize<T>(ReadOnlyMemory<byte>)
Section titled “ Deserialize<T>(ReadOnlyMemory<byte>)”Deserializes a value from a read-only memory region.
public T Deserialize<T>(ReadOnlyMemory<byte> data)Parameters
Section titled “Parameters”data ReadOnlyMemory<byte>
Returns
Section titled “Returns”T
Type Parameters
Section titled “Type Parameters”T
Deserialize(ReadOnlyMemory<byte>, Type)
Section titled “ Deserialize(ReadOnlyMemory<byte>, Type)”Deserializes a value from a read-only memory region to a specified type.
public object? Deserialize(ReadOnlyMemory<byte> data, Type type)Parameters
Section titled “Parameters”data ReadOnlyMemory<byte>
type Type
Returns
Section titled “Returns”Serialize<T>(IBufferWriter<byte>, T)
Section titled “ Serialize<T>(IBufferWriter<byte>, T)”Serializes a value into the supplied buffer writer.
public void Serialize<T>(IBufferWriter<byte> writer, T value)Parameters
Section titled “Parameters”writer IBufferWriter<byte>
value T
Type Parameters
Section titled “Type Parameters”T