MsgPackExt
Serializable::inspect
to show more useful information
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatscore :: union_find
union–find algorithm using an efficient disjoint-set data structuremsgpack :: serialization_write
Serialize full Nit objects to MessagePack format
# Application specific MessagePack extension `MsgPackExt`
module ext
import serialization
# Application specific MessagePack extension
class MsgPackExt
serialize
# Custom type code, in [0..127]
var typ: Int
# Data bytes
var data: Bytes
redef fun hash do return typ.hash + data.hash*8
redef fun ==(o) do return o isa MsgPackExt and o.typ == typ and o.data == data
redef fun to_s do return "<{class_name} typ: {typ.to_b}, data: {data.chexdigest}>"
end
lib/msgpack/ext.nit:15,1--33,3