struct

HTTP2::Frame

Inherits Struct < Value < Object

A passive HTTP/2 wire frame. Protocol and HPACK state belong to the connection layer, not frame values.

Constructors

Class methods

read(io : IO, max_frame_size : Int = FrameHeader::DEFAULT_MAX_PAYLOAD) : Frames
Source

Instance methods

data
Source
header
Source
initialize
Source
payload

payload is borrowed, not owned: constructing a frame from a String takes String#to_slice as-is (a view over the string's own immutable backing storage -- Crystal strings are never mutated in place, so no defensive copy is needed), and constructing one from Bytes has never copied either. Callers that hand a frame a mutable buffer must not mutate it afterward.

Source
stream_id
Source
type_code
Source
write(io : IO) : Nil

Writes the frame in its wire representation.

Source

Nested types