pub enum DecodeTerminator {
Require,
Tolerate,
Refuse(DecodeEmpties),
}Expand description
Whether a CONTROL terminator is required, tolerated or refused when
decoding a blob, and how empty elements are read without one.
The terminator is a single CONTROL at the end of a decode blob and
two consecutive CONTROLs at the end of a decode_all blob. Consecutive
CONTROLs are only meaningful as empty elements, so
DecodeTerminator::Refuse is the only variant that can read them:
with DecodeTerminator::Require or DecodeTerminator::Tolerate, a
terminator at the end of a blob is indistinguishable from a trailing
empty element.
Variants§
Require
Require the terminator; a blob without it is an error.
Tolerate
Accept a terminator at the end of the blob, but do not require one (default).
Refuse(DecodeEmpties)
Treat a terminator as an error and decide how consecutive
CONTROLs are read by decode_all.