Skip to content

Conversation

@extremeheat
Copy link
Contributor

Generated by Claude 4

loop

Reads a sequence of elements until a terminator or end of buffer:

// Read numbers until encountering 0
['loop', { type: 'i8', nt: 0 }]  // [1, 2, 3] from buffer [1, 2, 3, 0, ...]

// Read until end of buffer  
['loop', { type: 'i16', nt: null }]  // Read all remaining i16 values

restBuffer

Captures all remaining bytes as a Buffer:

// Protocol with header and payload
['container', [
  { name: 'header', type: 'u8' },
  { name: 'payload', type: 'restBuffer' }  // All remaining bytes
]]

After #169 , ProtoDef-io/ProtoDef#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant