Instance methods
binary_size(value : Bytes) : Int32
Sourcedecode(reader : IO::Memory) : Value
Sourcedescribed_list_size(code : UInt64, fields : Array(Value)) : Int32
Sourceencoded_size(value : Value) : Int32
Sourcenullable_string_size(value : String | Nil) : Int32
Sourceread_binary_value(reader : IO::Memory) : Bytes
Sourceread_bool_value(reader : IO::Memory) : Bool
Sourceread_byte(io : IO) : UInt8
Turns IO#read_byte's nilable return into the raising form AMQP10 always
wants; not a passthrough over read_bytes, so it earns its keep.
Sourceread_descriptor_code(reader : IO::Memory) : UInt64
Sourceread_size32(io : IO::Memory, type : String) : Int32
Reads a 32-bit size field and validates it against the remaining payload,
so a hostile oversized size cannot allocate or read past the buffer.
Sourceread_slice(io : IO::Memory, size : Int) : Bytes
Zero-copy view into io's own backing buffer, advancing pos past it. The
slice is only valid as long as the buffer is: callers decode and retire
it synchronously, so -- unlike amq-protocol's Table.from_io -- it is never
defensively copied when the source is writable.
Sourceread_string_value(reader : IO::Memory) : String | Nil
Sourceread_uint_value(reader : IO::Memory) : UInt64
Sourceskip_value(reader : IO::Memory) : Nil
Sourceskip_value_payload(reader : IO::Memory, code : UInt8) : Nil
Described values are skipped iteratively: a descriptor can itself be a
described value, nested without bound in untrusted input, so recursing
would let a crafted value exhaust the stack.
Sourceslice_from(io : IO::Memory, start : Int) : Bytes
The slice from an earlier saved position up to io's current pos.
Sourcestring_size(value : String) : Int32
Sourceuint_size(value) : Int32
Sourcewrite_array(io : IO, values : Array(Value)) : Nil
Sourcewrite_binary(io : IO, value : Bytes) : Nil
Sourcewrite_bool(io : IO, value : Bool) : Nil
Sourcewrite_described_list(io : IO, code : UInt64, fields : Array(Value)) : Nil
Sourcewrite_descriptor(io : IO, code : UInt64) : Nil
Shared with TransferCodec's direct-field writers below, and with
client.cr/types.cr's direct-field performative senders -- a single
implementation for the "described-list header" shape used throughout
AMQP 1.0's wire format, not a generic Value/Array round-trip.
Sourcewrite_f32(io : IO, value : Float32) : Nil
Sourcewrite_f64(io : IO, value : Float64) : Nil
Sourcewrite_i16(io : IO, value : Int16) : Nil
Sourcewrite_i32(io : IO, value : Int32) : Nil
Sourcewrite_i64(io : IO, value : Int64) : Nil
Sourcewrite_int(io : IO, value : Int64) : Nil
Sourcewrite_list(io : IO, values : Array(Value)) : Nil
Sourcewrite_long(io : IO, value : Int64) : Nil
Sourcewrite_map(io : IO, pairs : Array(Tuple(Value, Value))) : Nil
Sourcewrite_nullable_string(io : IO, value : String | Nil) : Nil
Sourcewrite_string(io : IO, value : String) : Nil
Sourcewrite_symbol(io : IO, value : String) : Nil
Sourcewrite_u16(io : IO, value : UInt16) : Nil
Sourcewrite_u32(io : IO, value : UInt32) : Nil
Sourcewrite_u64(io : IO, value : UInt64) : Nil
Sourcewrite_uint(io : IO, value : UInt64) : Nil
Sourcewrite_ulong(io : IO, value : UInt64) : Nil
Sourcewrite_value(io : IO, value : Value) : Nil
Source