pub enum DecodingKind {
InvalidEncoding,
OutOfRange,
Overflow,
InvalidTag,
Missing,
Trailing,
Unsupported,
}Expand description
Which fault a decoder found in the data it refused, so a responder can
name it (#1446). DecodingKind::reject_reason gives the Clause 18.9
Reject reason each kind draws when the data was a confirmed request.
Variants§
InvalidEncoding
Contents whose encoding isn’t valid for their datatype: a wrong
length, an Unsigned of no octets or with padding a canonical field
refuses, an unknown character set, a BIT STRING’s unused-bit count
past 7, and the like. The kind Error::decoding makes.
OutOfRange
A value too large for its field’s width, or outside the range the production or service gives it.
Overflow
More than the decoder takes: a count of items past its limit, or a tag length past its sanity bound.
InvalidTag
A tag that doesn’t fit where it stands: another number, class or form than the member there needs, a closing tag that closes no open frame, a tag header that is itself malformed, or an opening tag nested deeper than the decoder walks.
Missing
The data ends, or the enclosing frame closes, where a required member or a frame’s closing tag is due: a member is missing.
Trailing
Octets are left after the last member of a value that must fill its input: arguments beyond those the production has.
Unsupported
A well-formed encoding the decoder doesn’t handle: a CharacterString in a character set it can’t convert (IBM/Microsoft DBCS, JIS X 0208 or UCS-4).
Implementations§
Source§impl DecodingKind
impl DecodingKind
Sourcepub fn reject_reason(self) -> RejectReason
pub fn reject_reason(self) -> RejectReason
The Clause 18.9 Reject reason that names this fault in a confirmed request:
| Kind | Reject reason |
|---|---|
InvalidEncoding | INVALID_DATA_ENCODING |
OutOfRange | PARAMETER_OUT_OF_RANGE |
Overflow | BUFFER_OVERFLOW |
InvalidTag | INVALID_TAG |
Missing | MISSING_REQUIRED_PARAMETER |
Trailing | TOO_MANY_ARGUMENTS |
Unsupported | OTHER |