struct

Spacetime::BsatnRowList

Inherits Enumerable < Struct < Value < Object

Packed list of BSATN-encoded table rows transmitted in WebSocket updates.

Constructors

decode_bsatn(decoder : BSATN::Decoder) : self
Source
empty
Source
from_fixed_rows(row_size : UInt16, rows : Array(Bytes)) : self

Packs an array of fixed-width BSATN rows into a BsatnRowList using FixedSize.

Source
from_rows(rows : Array(Bytes)) : self

Packs an array of serialized BSATN row byte slices into a BsatnRowList using RowOffsets.

Source
new(size_hint : RowSizeHint = RowSizeHint.row_offsets, rows_data : Bytes = Bytes.empty)
Source

Instance methods

[](index : Int) : Bytes
Source
[]?(index : Int) : Bytes | Nil
Source
decode_rows(type : T.class) : Array(T(UInt8)) forall T

Decodes all rows in this list as instances of T.

Source
each

Must yield this collection's elements to the block.

Source
empty?

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.
Source
encode_bsatn(encoder : BSATN::Encoder) : Nil
Source
num_bytes

Total uncompressed byte length of rows_data.

Source
rows_data
Source
size

Number of rows in the list.

Source
size_hint
Source