class

HT2::Frame

Inherits Reference < Object

Base frame structure for HTTP/2

Constants

HEADER_SIZE = 9

Constructors

new(stream_id : UInt32, flags : FrameFlags = FrameFlags::None)
Source
parse(bytes : Bytes) : Frame

Parse complete frame from bytes

Source

Class methods

parse_header(bytes : Bytes) : Tuple(UInt32, FrameType, FrameFlags, UInt32)

Parse frame header from bytes

Source

Instance methods

flags
Source
frame_type
Source
length
Source
payload
Source
stream_id
Source
to_bytes(buffer_pool : BufferPool | Nil = nil) : Bytes

Serialize frame to bytes

Source
type
Source
write_to(io : IO, header_buffer : Bytes) : Nil

Write frame using provided header buffer (zero-copy)

Source
write_to(io : IO) : Nil

Write frame directly to IO without intermediate buffer (zero-copy)

Source