Add `{,Dynamic,Unbound}FieldSkipper()`.
It becomes increasingly common to do nothing in a field handler besides tracking
field presence. It is annoying to write lambdas which takes the value, context
parameters, and just returns `absl::OkStatus()`, and it feels uncertain whether
taking and ignoring the value is as efficient as it could (it almost is;
arranging for this to perform varint skipping instead of varint parsing is not
worth complicating the field handler protocol).
In contrast to `DynamicFieldCopier()`, `DynamicFieldSkipper()` field predicate
returns `bool` instead of `std::optional<int>`, because returning a destination
field number is not applicable.
In contrast to `AnyFieldCopier()`, `AnyFieldSkipper()` is not provided because
skipping remaining fields is the implicit default.
In contrast to `UnboundFieldCopier()`, `UnboundFieldSkipper()` can reuse the
implementation of `FieldSkipper()`, because it does not need a destination field
number.
Also, make public `FieldAccepted` and `FieldAcceptedIf` for dynamic field
handlers which carry no extra information about the field being accepted. The
field handler protocol requires an API which fits `std::unique_ptr` and
`std::optional` but not `bool`. These types are extracted from a private
implementation detail of `DynamicFieldHandler()`. They are used by
`DynamicFieldSkipper()` too.
Also, fix embarrassing compile errors in `FieldHandlerWrapper()` for dynamic
field handlers.
PiperOrigin-RevId: 914263217
Riegeli/records is a file format for storing a sequence of string records, typically serialized protocol buffers. It supports dense compression, fast decoding, seeking, detection and optional skipping of data corruption, filtering of proto message fields for even faster decoding, and parallel encoding.
See documentation.
Riegeli file format will only change in a backward compatible way (i.e. future readers will understand current files, but current readers might not understand files using future features).
Riegeli C++ API might change in incompatible ways.