Function readLengthDelimitedCursor

Read a length-delimited field payload as a borrowed child cursor.

WireCursor readLengthDelimitedCursor(
  scope ref return WireCursor cursor,
  uint fieldNumber,
  out bool ok,
  out WireStatus status
) nothrow @nogc @safe;

This is the DIP1000-friendly counterpart of readLengthDelimited for callers that already hold a scope cursor. The returned child cursor borrows the same backing bytes and cannot outlive the source cursor.

Parameters

NameDescription
cursor Cursor positioned at the field's encoded length.
fieldNumber Field number used for error reporting.
ok Receives true when a complete payload was available.
status Receives success or a precise length/payload decoding failure.

Returns

A cursor spanning exactly the payload bytes on success, or an empty cursor when ok is false.