pub enum DecodeError {
Show 13 variants
Empty,
MissingBeginString,
InvalidBodyLength,
ZeroBodyLength,
BodyLengthTooLarge {
declared: usize,
max: usize,
},
GroupNestingTooDeep {
max: usize,
},
BodyLengthMismatch {
declared: usize,
actual: usize,
},
MissingMsgType,
MissingChecksum,
ChecksumMismatch {
declared: u32,
computed: u32,
},
GarbledField {
offset: usize,
reason: &'static str,
},
Truncated {
offset: usize,
},
InvalidTag {
offset: usize,
},
}Expand description
Error decoding raw bytes into a Message.
Variants§
Empty
The input was empty.
MissingBeginString
The message does not start with BeginString (tag 8).
InvalidBodyLength
BodyLength (tag 9) is missing or not a valid number.
ZeroBodyLength
BodyLength (tag 9) is declared as exactly 0 (BUG-100/FR-014, feature 007) — every real FIX
message has a non-empty body (at minimum MsgType), matching QuickFIX/J (QFJ-903) and
QuickFIX/Go, which both reject this rather than framing an empty-body message. Distinct
from Self::InvalidBodyLength (missing/non-numeric) so the transport layer can treat it
like Self::BodyLengthTooLarge — closing the connection outright — rather than the
generic malformed-frame skip-and-resync recovery InvalidBodyLength gets.
BodyLengthTooLarge
BodyLength (tag 9) declares a frame larger than the configured/sane maximum (BUG-13/ FR-024, feature 006) — the connection must be closed instead of buffering unboundedly while waiting for that much data to arrive (a memory-exhaustion DoS vector, reachable pre- or post-Logon on any open acceptor port).
GroupNestingTooDeep
Dictionary-driven repeating-group nesting exceeded the defensive recursion limit.
BodyLengthMismatch
The declared BodyLength does not match the actual body size.
MissingMsgType
The third field is not MsgType (tag 35) — BUG-80/FR-049 (feature 007): every real FIX message has a MsgType immediately after BeginString/BodyLength (matching QuickFIX/J and QuickFIX/Go, which both require it); a message missing it entirely was previously accepted.
MissingChecksum
CheckSum (tag 10) is missing or not a valid number.
ChecksumMismatch
The declared CheckSum does not match the computed one.
GarbledField
A field could not be parsed.
Fields
Truncated
The input ended before a field was complete.
InvalidTag
A tag number was not a valid positive integer.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()