Table of Contents

Interface IDeltaPackApi<T>

Namespace
DeltaPack
Assembly
DeltaPack.dll

Core interface for DeltaPack serialization operations. Implementations are returned by Load<T>(IReadOnlyDictionary<string, SchemaType>, string) or generated code.

public interface IDeltaPackApi<T>

Type Parameters

T

The type being serialized (typically object? for interpreter, or specific types for codegen).

Methods

Clone(T)

Creates a deep copy of an object.

T Clone(T obj)

Parameters

obj T

Returns

T

Decode(byte[])

Deserializes an object from a byte array.

T Decode(byte[] buf)

Parameters

buf byte[]

Returns

T

DecodeDiff(T, byte[])

Applies a diff to reconstruct the current state from a previous state.

T DecodeDiff(T a, byte[] diff)

Parameters

a T

The previous state.

diff byte[]

The diff produced by EncodeDiff(T, T).

Returns

T

Encode(T)

Serializes an object to a byte array.

byte[] Encode(T obj)

Parameters

obj T

Returns

byte[]

EncodeDiff(T, T)

Encodes only the differences between two objects.

byte[] EncodeDiff(T a, T b)

Parameters

a T

The previous state.

b T

The current state.

Returns

byte[]

Equals(T, T)

Performs a deep equality comparison.

bool Equals(T a, T b)

Parameters

a T
b T

Returns

bool

FromJson(JsonElement)

Deserializes an object from a JSON element.

T FromJson(JsonElement json)

Parameters

json JsonElement

Returns

T

ToJson(T)

Serializes an object to a JSON element.

JsonElement ToJson(T obj)

Parameters

obj T

Returns

JsonElement