語言

SystemTextJsonFormatter 類別

定義

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

public class SystemTextJsonFormatter : StreamJsonRpc.FormatterBase, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.IJsonRpcMessageTextFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
type SystemTextJsonFormatter = class
    inherit FormatterBase
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcInstanceContainer
    interface IJsonRpcMessageFactory
    interface IJsonRpcFormatterTracingCallbacks
Public Class SystemTextJsonFormatter
Inherits FormatterBase
Implements IJsonRpcFormatterTracingCallbacks, IJsonRpcMessageFactory, IJsonRpcMessageTextFormatter
繼承
SystemTextJsonFormatter
實作

建構函式

名稱 Description
SystemTextJsonFormatter()

初始化 SystemTextJsonFormatter 類別的新執行個體。

屬性

名稱 Description
ApplicableMethodAttributeOnDeserializingMethod

取得 JsonRpcMethodAttribute 可用於服務來處理來請求的方法中存在的 。

(繼承來源 FormatterBase)
DuplexPipeTracker

獲得 RPC 方法參數來 marshaling pipes 的助手。

(繼承來源 FormatterBase)
Encoding

取得或設定用於序列化的方法的編碼,適用於不採用明確 Encoding的 。

EnumerableTracker

取得 RPC 方法參數或回傳值的編組 IAsyncEnumerable<T> 輔助工具。

(繼承來源 FormatterBase)
FormatterProgressTracker

取得 MessageFormatterProgressTracker 包含有用方法的實例,以協助實作訊息格式化器。

(繼承來源 FormatterBase)
JsonRpc

了解 JsonRpc 這個格式化器所關聯的部分。

(繼承來源 FormatterBase)
JsonSerializerOptions

取得或設定在序列化與反序列化包含使用者資料的 JSON 時所使用的選項。

MultiplexingStream

Gets 或 集合 可用 MultiplexingStream 來建立帶外通訊(例如 marshal IDuplexPipe 論證)。

(繼承來源 FormatterBase)

方法

名稱 Description
Deserialize(ReadOnlySequence<Byte>, Encoding)

將一串位元組反序列化為 JsonRpcMessage。

Deserialize(ReadOnlySequence<Byte>)

解序化 JsonRpcMessage.

Dispose()

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

(繼承來源 FormatterBase)
Dispose(Boolean)

處理此實例持有的管理及本地資源。

(繼承來源 FormatterBase)
GetJsonText(JsonRpcMessage)

它會為特定訊息取得 JSON 表示以供追蹤。

Serialize(IBufferWriter<Byte>, JsonRpcMessage)

序列化為 JsonRpcMessage.

TrackDeserialization(JsonRpcMessage, ReadOnlySpan<ParameterInfo>)

設定狀態以追蹤訊息的反序列化。

(繼承來源 FormatterBase)
TrackSerialization(JsonRpcMessage)

設定狀態以追蹤訊息的序列化。

(繼承來源 FormatterBase)

明確介面實作

名稱 Description
IJsonRpcFormatterState.DeserializingMessageWithId

取得目前正在解序的回應的 ID。

(繼承來源 FormatterBase)
IJsonRpcFormatterState.SerializingMessageWithId

取得目前序列化的請求或回應的 ID。

(繼承來源 FormatterBase)
IJsonRpcFormatterState.SerializingRequest

會得到一個值,表示 a JsonRpcRequest 是否正在被序列化。

(繼承來源 FormatterBase)
IJsonRpcFormatterTracingCallbacks.OnSerializationComplete(JsonRpcMessage, ReadOnlySequence<Byte>)

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

IJsonRpcInstanceContainer.Rpc

設定實 JsonRpc 例。

(繼承來源 FormatterBase)
IJsonRpcMessageFactory.CreateErrorMessage()

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

IJsonRpcMessageFactory.CreateRequestMessage()

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

IJsonRpcMessageFactory.CreateResultMessage()

一個格式化器,會輸出 UTF-8 編碼的 JSON,使用者資料應可透過 JsonSerializer.

適用於