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
TThe 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
objT
Returns
- T
Decode(byte[])
Deserializes an object from a byte array.
T Decode(byte[] buf)
Parameters
bufbyte[]
Returns
- T
DecodeDiff(T, byte[])
Applies a diff to reconstruct the current state from a previous state.
T DecodeDiff(T a, byte[] diff)
Parameters
aTThe previous state.
diffbyte[]The diff produced by EncodeDiff(T, T).
Returns
- T
Encode(T)
Serializes an object to a byte array.
byte[] Encode(T obj)
Parameters
objT
Returns
- byte[]
EncodeDiff(T, T)
Encodes only the differences between two objects.
byte[] EncodeDiff(T a, T b)
Parameters
aTThe previous state.
bTThe current state.
Returns
- byte[]
Equals(T, T)
Performs a deep equality comparison.
bool Equals(T a, T b)
Parameters
aTbT
Returns
FromJson(JsonElement)
Deserializes an object from a JSON element.
T FromJson(JsonElement json)
Parameters
jsonJsonElement
Returns
- T
ToJson(T)
Serializes an object to a JSON element.
JsonElement ToJson(T obj)
Parameters
objT