pub const ERROR_RAW_CAP: usize = 4096;Expand description
The most bytes a recorder may put in an Error event’s
"raw". Fixed by the format — SPEC.md, Event 6, under the heading about
the cap and "rawlen".
The cap binds the party building an event out of bytes it has just
observed, and nothing else. It is deliberately not enforced when an
event is serialized, and this crate does not enforce it there: a serializer
cannot tell a freshly recorded event from one that arrived by being read,
so a cap applied at that point either shortens evidence on a rewrite or
refuses a file the reader was required to accept — whichever it does, it
does to the wrong events. A "raw" longer than this reads back at its full
length and is written back at its full length.
EventData::error_observed is where the cap belongs and where this crate
applies it. A recorder assembling the variant by hand applies it here.
One obligation stays with the recorder and cannot live in a constructor at
all: SPEC.md allows "raw" once per flow — per stream where the error names
one, per peer where it does not. Later errors on that flow are still
recorded and simply carry no bytes. That is state across events, so it
belongs to whatever is holding the flow.