Table of Contents

Class CodecContext

Namespace
Shard.Codecs
Assembly
Shard.Codecs.dll

Carries version, diagnostic path, depth limits, and bounded diagnostics for one root codec operation.

public sealed class CodecContext
Inheritance
CodecContext
Inherited Members

Remarks

Because each context belongs to one root operation, it carries no registry, service, or ambient application state.

Constructors

CodecContext(int)

public CodecContext(int version = 0)

Parameters

version int

Fields

MaximumPathDepth

public const int MaximumPathDepth = 64

Field Value

int

MaximumRenderedPathLength

public const int MaximumRenderedPathLength = 1024

Field Value

int

MaximumRetainedDiagnostics

public const int MaximumRetainedDiagnostics = 64

Field Value

int

MaximumRetainedMessageLength

public const int MaximumRetainedMessageLength = 1024

Field Value

int

MaximumSemanticDepth

public const int MaximumSemanticDepth = 64

Field Value

int

Properties

Diagnostics

public IReadOnlyList<CodecDiagnostic> Diagnostics { get; }

Property Value

IReadOnlyList<CodecDiagnostic>

DiagnosticsTruncated

public bool DiagnosticsTruncated { get; }

Property Value

bool

HasFailures

public bool HasFailures { get; }

Property Value

bool

IsActive

public bool IsActive { get; }

Property Value

bool

Path

public string Path { get; }

Property Value

string

Version

public int Version { get; }

Property Value

int

Methods

Fail(string)

public void Fail(string message)

Parameters

message string

PushIndex(int)

Adds an array index to the diagnostic path until the returned scope is disposed.

public CodecPathScope PushIndex(int index)

Parameters

index int

Returns

CodecPathScope

PushProperty(string)

Adds a property to the diagnostic path until the returned scope is disposed.

public CodecPathScope PushProperty(string name)

Parameters

name string

Returns

CodecPathScope

Warn(string)

public void Warn(string message)

Parameters

message string