struct

LavinMQ::MQTT::BytesTokenIterator

Inherits Struct < Value < Object

Splits a buffer on a delimiter byte, yielding each part as a Bytes view into the buffer (no allocation per token). Empty parts are returned, so "/" yields two empty tokens and "a//b" yields "a", "" and "b".

The delimiter must be a single ASCII byte; splitting on ASCII over a UTF-8 buffer is safe because UTF-8 multi-byte sequences only use bytes >= 0x80.

Constructors

new(bytes : Bytes, delimiter : Char = '/')
Source

Instance methods

next
Source
next?
Source
to_s

Renders the whole filter the iterator was built from. The cursor only tracks how far iteration has progressed; it never narrows the backing buffer, so this returns the complete filter regardless of position.

Source