Skip to content

IWorkspaceCreatedDocument

Definition

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

A IWorkspaceManagedDocument that records the workspace which created it, so that it is disposed only by its creator — never by another workspace that merely referenced it.

public interface IWorkspaceCreatedDocument : IWorkspaceManagedDocument, IJsonDocument, IDisposable

Remarks

A workspace's document table (JsonWorkspace) registers a document both when it creates one and when it references one from another workspace to resolve a cross-workspace value (the referenced document's value bytes are addressed by its index in the referencing workspace). Disposal must distinguish the two: disposing a document that another workspace created — and still owns — corrupts that workspace. A document implementing this interface is disposed by a workspace only when CreatingWorkspace is that workspace. Implemented by builders (JsonDocumentBuilder), whose creator is fixed at construction and is never changed by being referenced elsewhere.

Implements

IWorkspaceManagedDocument, IJsonDocument, IDisposable

Implemented By

JsonDocumentBuilder<T>

Properties

Property Type Description
CreatingWorkspace JsonWorkspace Gets the workspace that created this document and is therefore responsible for disposing it.

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