Skip to main content

encode_batch

Function encode_batch 

Source
pub fn encode_batch(params: &BatchParams<'_>) -> Vec<u8> 
Expand description

Encode a FlatBuffer Batch message.

Layout:

[4 bytes: root offset] -> points to table
[vtable]
  - vtable_size (u16)
  - table_size (u16)
  - field offsets (u16 each, 0 = not present)
[table]
  - soffset to vtable (i32)
  - inline scalars and vector offsets
[vectors]
  - length (u32) + data bytes

Batch fields:

  • field 0: api_key [ubyte] (required)
  • field 1: schema_type u8
  • field 2: version u8
  • field 3: batch_id u64
  • field 4: data [ubyte] (required)
  • field 5: source_ip [ubyte] (not used by SDKs)