ankh v0.4.6 Ankh.Frame

HTTP/2 frame struct

The using macro injects the frame struct needed by Ankh.Frame.

Link to this section Summary

Types

Frame length

Encode/Decode options

t()

Struct injected by the Ankh.Frame using macro

Frame type code

Functions

Injects the frame struct in a module

Decodes a binary into a frame struct

Encodes a frame struct into binary

Peek frames from a buffer, returning the frame header information and data (without decoding it) and the leftover buffer data

Link to this section Types

Link to this type length()
length() :: integer()

Frame length

Link to this type options()
options() :: Keyword.t()

Encode/Decode options

Link to this type t()
t() :: term() | nil

Struct injected by the Ankh.Frame using macro.

Link to this type type()
type() :: integer()

Frame type code

Link to this section Functions

Link to this macro __using__(args) (macro)
__using__(
  type: type(),
  flags: Ankh.Frame.Encodable.t(),
  payload: Ankh.Frame.Encodable.t()
) :: Macro.t()

Injects the frame struct in a module.

  • type: HTTP/2 frame type code
  • flags: frame flags struct or nil for no flags
  • payload: frame payload struct or nil for no payload
Link to this function decode!(frame, data, options \\ [])
decode!(t(), binary(), options()) :: t()

Decodes a binary into a frame struct

Parameters:

  • struct: struct using Ankh.Frame
  • binary: data to decode into the struct
  • options: options to pass as context to the decoding function
Link to this function encode!(frame, options \\ [])
encode!(t(), options()) :: iodata()

Encodes a frame struct into binary

Parameters:

  • struct: struct using Ankh.Frame
  • options: options to pass as context to the encoding function
Link to this function peek_frames(data)
peek_frames(iodata()) ::
  {iodata(), [{length(), type(), Ankh.Stream.id(), iodata()}]}

Peek frames from a buffer, returning the frame header information and data (without decoding it) and the leftover buffer data.