MessagePackFormatter 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用 MessagePack 序列化 JSON-RPC 消息(快速压缩的二进制格式)。
public class MessagePackFormatter : IDisposable, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.IJsonRpcMessageFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterState, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
public class MessagePackFormatter : StreamJsonRpc.FormatterBase, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.IJsonRpcMessageFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
public class MessagePackFormatter : IDisposable, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.IJsonRpcMessageFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterState, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
type MessagePackFormatter = class
interface IJsonRpcMessageFormatter
interface IJsonRpcInstanceContainer
interface IJsonRpcFormatterState
interface IJsonRpcFormatterTracingCallbacks
interface IJsonRpcMessageFactory
interface IDisposable
type MessagePackFormatter = class
inherit FormatterBase
interface IJsonRpcMessageFormatter
interface IJsonRpcFormatterTracingCallbacks
interface IJsonRpcMessageFactory
type MessagePackFormatter = class
interface IJsonRpcMessageFormatter
interface IJsonRpcInstanceContainer
interface IJsonRpcFormatterState
interface IJsonRpcFormatterTracingCallbacks
interface IDisposable
Public Class MessagePackFormatter
Implements IDisposable, IJsonRpcFormatterState, IJsonRpcFormatterTracingCallbacks, IJsonRpcInstanceContainer, IJsonRpcMessageFactory, IJsonRpcMessageFormatter
Public Class MessagePackFormatter
Inherits FormatterBase
Implements IJsonRpcFormatterTracingCallbacks, IJsonRpcMessageFactory, IJsonRpcMessageFormatter
Public Class MessagePackFormatter
Implements IDisposable, IJsonRpcFormatterState, IJsonRpcFormatterTracingCallbacks, IJsonRpcInstanceContainer, IJsonRpcMessageFormatter
- 继承
-
MessagePackFormatter
- 继承
- 实现
注解
此处使用的 MessagePack 实现来自 https://github.com/neuecc/MessagePack-CSharp. 该项目网站上的自述文件描述了用例及其性能,与替代.NET MessagePack 实现相比,这一项似乎是迄今为止最好的。
构造函数
| 名称 | 说明 |
|---|---|
| MessagePackFormatter() |
初始化 MessagePackFormatter 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| ApplicableMethodAttributeOnDeserializingMethod |
JsonRpcMethodAttribute获取可用于为传入请求提供服务(如果适用)的方法上存在的。 (继承自 FormatterBase) |
| DefaultUserDataSerializationOptions |
获取在任何调用SetMessagePackSerializerOptions(MessagePackSerializerOptions)之前,RPC 调用中用于用户数据(参数、返回值和错误)的默认值MessagePack.MessagePackSerializerOptions。 |
| DuplexPipeTracker |
获取作为 RPC 方法参数封送管道的帮助程序。 (继承自 FormatterBase) |
| EnumerableTracker |
获取用于在 RPC 方法参数或返回值中封送 IAsyncEnumerable<T> 的帮助程序。 (继承自 FormatterBase) |
| FormatterProgressTracker |
MessageFormatterProgressTracker获取包含有用方法的实例,以帮助实现消息格式化程序。 (继承自 FormatterBase) |
| JsonRpc |
获取与此格式化程序关联的项 JsonRpc 。 (继承自 FormatterBase) |
| MultiplexingStream |
获取或设置 MultiplexingStream 可用于建立带外通信(例如封送 IDuplexPipe 参数)的函数。 |
方法
| 名称 | 说明 |
|---|---|
| Deserialize(ReadOnlySequence<Byte>) |
反序列化 .JsonRpcMessage |
| Dispose() |
使用 MessagePack 序列化 JSON-RPC 消息(快速压缩的二进制格式)。 |
| Dispose() |
使用 MessagePack 序列化 JSON-RPC 消息(快速压缩的二进制格式)。 (继承自 FormatterBase) |
| Dispose(Boolean) |
释放此实例保留的托管资源和本机资源。 |
| Dispose(Boolean) |
释放此实例保留的托管资源和本机资源。 (继承自 FormatterBase) |
| GetJsonText(JsonRpcMessage) |
获取给定消息的 JSON 表示形式,以便进行跟踪。 |
| Serialize(IBufferWriter<Byte>, JsonRpcMessage) |
序列化一个 JsonRpcMessage. |
| SetMessagePackSerializerOptions(MessagePackSerializerOptions) |
MessagePack.MessagePackSerializerOptions设置用于用户数据的序列化。 |
| TrackDeserialization(JsonRpcMessage, ReadOnlySpan<ParameterInfo>) |
设置状态以跟踪消息的反序列化。 (继承自 FormatterBase) |
| TrackSerialization(JsonRpcMessage) |
设置状态以跟踪消息的序列化。 (继承自 FormatterBase) |