[roll pigweed] pw_protobuf: Add StreamEncoder::CloseEncoder

Previously, `StreamEncoder` would only perform writes to its parent
after destruction occurred. This resulted in callers frequently needing
to introduce new scopes, often with a comment explaining the API to
readers.

This change adds the `CloseEncoder` method, which explicitly finalizes
the child encoder and performs the writes to the parent, allowing users
both to close an encoder before the end of its lexical scope and to make
their code more explicit and self-descriptive if desired.

Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/103922

https://pigweed.googlesource.com/pigweed/pigweed
pigweed Rolled-Commits: c8bb7b15b66e57e..07a61ccf0226a5a
Roller-URL: https://ci.chromium.org/b/8807264204315286817
Cq-Cl-Tag: roller-builder:pigweed-zephyr-roller
Cq-Cl-Tag: roller-bid:8807264204315286817
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I9186094f868811df284c3bb2b4d5894b18f1d2ae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/zephyr-integration/+/103889
Commit-Queue: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com>
Bot-Commit: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com>
1 file changed
tree: ec3a166495ad751b8fc2908da67d1ed7b1ee462c
  1. .gitmodules
  2. test.sh