JsonWriterState JsonWriterState JsonWriterState JsonWriterState Struct

Definition

Defines an opaque type that holds and saves all the relevant state information which must be provided to the Utf8JsonWriter struct to continue writing after completing a partial write.

public value class JsonWriterState
public struct JsonWriterState
type JsonWriterState = struct
Public Structure JsonWriterState
Inheritance
JsonWriterStateJsonWriterStateJsonWriterStateJsonWriterState

Remarks

This type is required to support reentrancy when writing incomplete data and to continue writing in chunks. Unlike the <xref:System.Text.Json.Utf8JsonWriter" />, which is a ref struct, this type can survive across async/await boundaries, and hence this type is required to provide support for writing more JSON text asynchronously before continuing with a new instance of the Utf8JsonWriter.

Constructors

JsonWriterState(JsonWriterOptions) JsonWriterState(JsonWriterOptions) JsonWriterState(JsonWriterOptions) JsonWriterState(JsonWriterOptions)

Initializes a new instance of the JsonWriterState struct.

Properties

BytesCommitted BytesCommitted BytesCommitted BytesCommitted

Gets the total number of bytes committed to the output by the Utf8JsonWriter struct so far. This indicates how much the IBufferWriter<T> has advanced.

BytesWritten BytesWritten BytesWritten BytesWritten

Gets the total number of bytes written by the Utf8JsonWriter struct so far. This includes data that has been written beyond what has already been committed.

Options Options Options Options

Gets the custom behavior to use when writing JSON data using the Utf8JsonWriter struct.

Applies to