Function PbfWriter.write

Serialize current known semantic state.

bool write(
  ref const(PbfDocument) document,
  ref ubyte[] output,
  out PbfWriteStatus status,
  PbfWriteOptions options = PbfWriteOptions(0LU)
) @safe;

The operation fails when document.preservation.semanticRewriteSafe is false. Legal protobuf representation may differ from the input: the writer emits regular Nodes, canonical packed repeated scalars, a deterministic per-block StringTable and raw Blob payloads.