BridgeValueCodec<T> class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class BridgeValueCodec<T>

A generated, typed JSON value codec for a Runic bridge contract.

Remarks

Generated bridge code supplies direct readers and writers for every member. This keeps application execution independent of reflection-based JSON metadata, which is important for trimming and Native AOT.

Constructors

BridgeValueCodec

public BridgeValueCodec(Func<JsonElement, T> read, Action<Utf8JsonWriter, T> write)

A generated, typed JSON value codec for a Runic bridge contract.

Remarks

Generated bridge code supplies direct readers and writers for every member. This keeps application execution independent of reflection-based JSON metadata, which is important for trimming and Native AOT.

Methods

Decode

public T Decode(JsonElement value)

Decodes one JSON value.

Decode

public T Decode(string json)

Decodes one complete JSON document.

Encode

public void Encode(Utf8JsonWriter writer, T value)

Writes one JSON value into the current writer context.

Encode

public string Encode(T value)

Writes a complete, canonical JSON value.

StructuralEquals

public bool StructuralEquals(T left, T right)

Compares values by their canonical wire representation. It deliberately does not rely on CLR equality, which may have different semantics from the generated frontend contract.