<PackageReference Include="System.Text.Json" Version="6.0.8" />

WriteStack

struct WriteStack
public string BoxedStructReferenceId

Stores a reference id that has been calculated by a polymorphic converter handling a newly encountered boxed struct.

Cancellation token used by converters performing async serialization (e.g. IAsyncEnumerable)

List of completed IAsyncDisposables that have been scheduled for disposal by converters.

Exposes the stackframe that is currently active.

public int FlushThreshold

The amount of bytes to write before the underlying Stream should be flushed and the current buffer adjusted to remove the processed bytes.

Stores a pending task that a resumable converter depends on to continue work. It must be awaited by the root context before serialization is resumed.

public bool SupportContinuation

Internal flag to let us know that we need to read ahead in the inner read loop.

public bool SuppressFlush

In the case of async serialization, used by resumable converters to signal that the current buffer contents should not be flushed to the underlying stream.

public bool IsContinuation { get; }

Indicates that the state still contains suspended frames waiting re-entry.

public void AddCompletedAsyncDisposable(IAsyncDisposable asyncDisposable)

Walks the stack cleaning up any leftover IDisposables in the event of an exception on serialization

Walks the stack cleaning up any leftover I(Async)Disposables in the event of an exception on async serialization

public JsonConverter Initialize(Type type, JsonSerializerOptions options, bool supportContinuation)

Initialize the state without delayed initialization of the JsonTypeInfo.

public void Pop(bool success)

public string PropertyPath()

public void Push()