ankh v0.3.1 Ankh.Frame.Payload protocol

Protocol for enoding/decoding payload structs

Summary

Types

t()

Struct conforming to the Ankh.Frame.Payload protocol

Functions

Decodes a binary into a conforming struct

Encodes a conforming struct into binary or IO list

Types

t()
t() :: struct

Struct conforming to the Ankh.Frame.Payload protocol

Functions

decode!(struct, binary, options)
decode!(t, binary, Keyword.t) :: t

Decodes a binary into a conforming struct

Parameters:

  • struct: struct conforming to the Ankh.Frame.Payload protocol
  • binary: data to decode into the struct
  • options: options to pass as context to the decoding function
encode!(struct, options)
encode!(t, Keyword.t) :: binary | [binary]

Encodes a conforming struct into binary or IO list

Parameters:

  • struct: struct conforming to the Ankh.Frame.Payload protocol
  • options: options to pass as context to the encoding function