module
TLV::Serializable
Defined in:
tlv/serializable.crClass Method Summary
-
.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
-
.deserialize_value(any : TLV::Any, type : Array(T).class) : Array(T) forall T
Handle Arrays - elements are stored as TLV List/Array
-
.deserialize_value(any : TLV::Any, type : Nil.class) : Nil
Helper methods for deserialization
- .deserialize_value(any : TLV::Any, type : Bool.class) : Bool
- .deserialize_value(any : TLV::Any, type : Int8.class) : Int8
- .deserialize_value(any : TLV::Any, type : Int16.class) : Int16
- .deserialize_value(any : TLV::Any, type : Int32.class) : Int32
- .deserialize_value(any : TLV::Any, type : Int64.class) : Int64
- .deserialize_value(any : TLV::Any, type : UInt8.class) : UInt8
- .deserialize_value(any : TLV::Any, type : UInt16.class) : UInt16
- .deserialize_value(any : TLV::Any, type : UInt32.class) : UInt32
- .deserialize_value(any : TLV::Any, type : UInt64.class) : UInt64
- .deserialize_value(any : TLV::Any, type : Float32.class) : Float32
- .deserialize_value(any : TLV::Any, type : Float64.class) : Float64
- .deserialize_value(any : TLV::Any, type : String.class) : String
- .deserialize_value(any : TLV::Any, type : Bytes.class) : Bytes
- .deserialize_value(any : TLV::Any, type : TLV::Any.class) : TLV::Any
-
.deserialize_value(any : TLV::Any, type : T.class) : T forall T
Handle Serializable types, enum types, and union types (catch-all with macro check)
-
.serialize_array_as_list(value : Array(T), tag) : TLV::Any forall T
Handle Arrays - serialize as TLV List (heterogeneous format)
-
.serialize_value(value : Array(T), tag, fixed_size : Bool = false) : TLV::Any forall T
Handle Arrays - default to TLV Array
-
.serialize_value(value : Nil, tag, fixed_size : Bool = false) : TLV::Any
Helper methods for serialization
- .serialize_value(value : Bool, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Int8, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Int16, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Int32, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Int64, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : UInt8, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : UInt16, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : UInt32, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : UInt64, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Float32, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Float64, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : String, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : Bytes, tag, fixed_size : Bool = false) : TLV::Any
- .serialize_value(value : TLV::Any, tag, fixed_size : Bool = false) : TLV::Any
-
.serialize_value(value : T, tag, fixed_size : Bool = false) : TLV::Any forall T
Handle Serializable types, enum types, and union types (catch-all)
Macro Summary
-
deserialize_tuple(any, tuple_type)
Handle Tuples - elements are stored as TLV List
-
deserialize_tuple_field(any, tuple_type, class_name, field_name, tag)
Handle Tuples with error context
-
serialize_tuple(value, tuple_type, tag, as_array = false)
Handle Tuples - serialize each element, default to TLV List
Class Method Detail
Wrapper for deserialization with improved error messages
Handle Arrays - elements are stored as TLV List/Array
Helper methods for deserialization
Handle Serializable types, enum types, and union types (catch-all with macro check)
Handle Arrays - serialize as TLV List (heterogeneous format)
Handle Arrays - default to TLV Array
Helper methods for serialization
Handle Serializable types, enum types, and union types (catch-all)
Macro Detail
Handle Tuples with error context
Handle Tuples - serialize each element, default to TLV List