ankh v0.6.0 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
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
Stream frames from a buffer, returning the leftover buffer data and the frame header information and data (without decoding it) in a tuple: {remaining_buffer, {length, type, id, frame_data}}
Link to this section Types
length()
length() :: integer()
length() :: integer()
Frame length
options()
options() :: Keyword.t()
options() :: Keyword.t()
Encode/Decode options
t()
t() :: term() | nil
t() :: term() | nil
Struct injected by the Ankh.Frame
using macro.
type()
type() :: integer()
type() :: integer()
Frame type code
Link to this section Functions
__using__(args)
(macro)
__using__(
type: type(),
flags: Ankh.Frame.Encodable.t(),
payload: Ankh.Frame.Encodable.t()
) :: Macro.t()
__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
decode!(frame, data, options \\ [])
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
encode!(frame, options \\ [])
Encodes a frame struct into binary
Parameters:
- struct: struct using
Ankh.Frame
- options: options to pass as context to the encoding function
stream_frames(data)
stream_frames(iodata()) :: Enumerable.t()
stream_frames(iodata()) :: Enumerable.t()
Stream frames from a buffer, returning the leftover buffer data and the frame header information and data (without decoding it) in a tuple: {remaining_buffer, {length, type, id, frame_data}}