struct

Crabbit::AMQP::Decoder

Inherits Struct < Value < Object

Bounds-checked decoder for generic AMQP 1.0 values.

Decoding copies binary values by default. With zero_copy, returned binary slices reference the input buffer; callers must keep it alive and immutable.

Constants

MAX_CONTAINER_ELEMENTS = 1000000

Maximum number of elements accepted from an AMQP container declaration.

Constructors

new(bytes : Bytes, position : Int32 = 0, *, zero_copy : Bool = false)

Creates a decoder at position in bytes.

Source

Instance methods

bytes

Returns the complete input buffer.

Source
consume_described_descriptor(expected : UInt64) : Nil

Consumes the next numeric descriptor and validates it against expected.

Source
eof?

Returns whether all input bytes have been consumed.

Source
peek_described_descriptor

Returns the numeric descriptor of the next described value without consuming input, or nil when it is absent or non-numeric.

Source
position

Returns the next unread byte position.

Source
read

Reads and returns one complete AMQP value.

Source
read_binary

Reads one AMQP binary value.

Source
read_list_values

Reads one AMQP list and returns its element values.

Source
read_map_values

Reads one AMQP map and returns its entries.

Source
remaining

Returns the number of unread input bytes.

Source