Skip to content

IJsonDocument.CloneElementAsBuilder Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: IJsonDocument.cs

CloneElementAsBuilder(int, JsonWorkspace)

Creates a standalone copy of the element at the specified index as a new document owned by workspace.

public abstract JsonDocumentBuilder<JsonElement.Mutable> CloneElementAsBuilder(int index, JsonWorkspace workspace)

Parameters

Name Type Description
index int The index of the element to copy.
workspace JsonWorkspace The workspace that will own the cloned document.

Returns

JsonDocumentBuilder<JsonElement.Mutable>

A workspace-owned builder containing the standalone copy.

Remarks

The returned document is fully independent of this document and its backing storage (both the metadata and the value bytes are copied), so this document may be disposed without affecting the copy. The copy lives for the lifetime of workspace.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue