tl v57.0.0-beta TL.Serializer

Module for detecting packet type and automatically decoding it

Summary

Functions

Detects and decodes packet, returns struct with decoded data

Detects and decodes packet, returns struct with decoded data and rest of the unused packet

Detects packet type, accepts binary and returns atom :mtproto or :tl

Encodes TL term to binary

Functions

decode(packet)
decode(binary) :: struct

Detects and decodes packet, returns struct with decoded data

decode_rest(packet)
decode_rest(binary) :: {struct, binary}

Detects and decodes packet, returns struct with decoded data and rest of the unused packet

detect(arg1)
detect(binary) :: :mtproto | :tl

Detects packet type, accepts binary and returns atom :mtproto or :tl

encode(struct)
encode(term) :: binary

Encodes TL term to binary