PPNet.Message behaviour (pp_net v0.1.5)

Copy Markdown View Source

This module defines the PPNet.Message protocol, which provides functions to pack and parse messages.

Summary

Callbacks

datetime(message)

@callback datetime(message :: struct()) :: DateTime.t()

pack(message)

@callback pack(message :: struct()) :: binary()

parse(data)

@callback parse(data :: binary()) ::
  {:ok, struct()}
  | {:error, %PPNet.ParseError{data: term(), message: term(), reason: term()}}

type_code()

@callback type_code() :: non_neg_integer()