module

TLV::Serializable

Class methods

deserialize_field(any : TLV::Any, type : T.class, class_name : String, field_name : String, tag : String) : T forall T

Wrapper for deserialization with improved error messages

Source
deserialize_value(any : TLV::Any, type : Array(T).class) : Array(T) forall T

Handle Arrays - elements are stored as TLV List/Array

Source
deserialize_value(any : TLV::Any, type : Nil.class) : Nil

Helper methods for deserialization

Source
deserialize_value(any : TLV::Any, type : Bool.class) : Bool
Source
deserialize_value(any : TLV::Any, type : Int8.class) : Int8
Source
deserialize_value(any : TLV::Any, type : Int16.class) : Int16
Source
deserialize_value(any : TLV::Any, type : Int32.class) : Int32
Source
deserialize_value(any : TLV::Any, type : Int64.class) : Int64
Source
deserialize_value(any : TLV::Any, type : UInt8.class) : UInt8
Source
deserialize_value(any : TLV::Any, type : UInt16.class) : UInt16
Source
deserialize_value(any : TLV::Any, type : UInt32.class) : UInt32
Source
deserialize_value(any : TLV::Any, type : UInt64.class) : UInt64
Source
deserialize_value(any : TLV::Any, type : Float32.class) : Float32
Source
deserialize_value(any : TLV::Any, type : Float64.class) : Float64
Source
deserialize_value(any : TLV::Any, type : String.class) : String
Source
deserialize_value(any : TLV::Any, type : Bytes.class) : Bytes
Source
deserialize_value(any : TLV::Any, type : TLV::Any.class) : TLV::Any
Source
deserialize_value(any : TLV::Any, type : T.class) : T forall T

Handle Serializable types, enum types, and union types (catch-all with macro check)

Source
serialize_array_as_list(value : Array(T), tag) : TLV::Any forall T

Handle Arrays - serialize as TLV List (heterogeneous format)

Source
serialize_value(value : Array(T), tag, fixed_size : Bool = false) : TLV::Any forall T

Handle Arrays - default to TLV Array

Source
serialize_value(value : Nil, tag, fixed_size : Bool = false) : TLV::Any

Helper methods for serialization

Source
serialize_value(value : Bool, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Int8, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Int16, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Int32, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Int64, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : UInt8, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : UInt16, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : UInt32, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : UInt64, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Float32, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Float64, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : String, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : Bytes, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : TLV::Any, tag, fixed_size : Bool = false) : TLV::Any
Source
serialize_value(value : T, tag, fixed_size : Bool = false) : TLV::Any forall T

Handle Serializable types, enum types, and union types (catch-all)

Source

Macros

deserialize_tuple(any, tuple_type)

Handle Tuples - elements are stored as TLV List

Source
deserialize_tuple_field(any, tuple_type, class_name, field_name, tag)

Handle Tuples with error context

Source
serialize_tuple(value, tuple_type, tag, as_array = false)

Handle Tuples - serialize each element, default to TLV List

Source