Object.Serialization (object v0.1.2)
Serialization and deserialization for Object instances.
Provides multiple serialization formats optimized for different use cases:
- ETF (Erlang Term Format) - Native, fast, compact
- JSON - Human-readable, widely compatible
- Protocol Buffers - Efficient, schema-based
- MessagePack - Compact binary format
Features
- Multiple format support with automatic negotiation
- Schema versioning and migration
- Partial serialization for large objects
- Compression support
- Type preservation across formats
- Streaming serialization for large data
Summary
Functions
Calculates serialized size without actually serializing.
Deserializes binary data back into an Object.
Serializes an Object to the specified format.
Serializes only specific fields of an object.
Streams serialization for large objects.
Types
Functions
@spec calculate_size(Object.t(), serialize_opts()) :: {:ok, non_neg_integer()} | {:error, term()}
Calculates serialized size without actually serializing.
Deserializes binary data back into an Object.
@spec serialize(Object.t(), serialize_opts()) :: {:ok, binary()} | {:error, term()}
Serializes an Object to the specified format.
@spec serialize_partial(Object.t(), [atom()], serialize_opts()) :: {:ok, binary()} | {:error, term()}
Serializes only specific fields of an object.
@spec serialize_stream(Object.t(), serialize_opts()) :: Enumerable.t()
Streams serialization for large objects.