#[non_exhaustive]pub enum DecodeError {
Show 14 variants
Incomplete,
InvalidBeginString,
MissingBodyLength,
InvalidBodyLength,
MissingMsgType,
ChecksumMismatch {
calculated: u8,
declared: u8,
},
InvalidTag(String),
MissingRequiredField {
tag: u32,
},
InvalidFieldValue {
tag: u32,
reason: String,
},
InvalidUtf8(Utf8Error),
UnterminatedField {
tag: u32,
},
InvalidDataLength {
data_tag: u32,
declared: usize,
available: usize,
},
RangeOutOfBounds {
start: usize,
end: usize,
buffer_len: usize,
},
InvalidMsgType(MsgTypeError),
}Expand description
Errors that occur during FIX message decoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Incomplete
Message buffer is incomplete, need more data.
InvalidBeginString
Invalid BeginString field (tag 8).
MissingBodyLength
Missing BodyLength field (tag 9).
InvalidBodyLength
Invalid BodyLength value.
MissingMsgType
Missing MsgType field (tag 35).
ChecksumMismatch
Checksum mismatch between calculated and declared values.
InvalidTag(String)
Invalid tag format (not a valid integer).
MissingRequiredField
Missing required field.
InvalidFieldValue
Invalid field value for the expected type.
InvalidUtf8(Utf8Error)
Invalid UTF-8 in string field.
UnterminatedField
A field is not terminated by the SOH delimiter.
Distinct from DecodeError::Incomplete: the tag was well formed, so
the bytes are structurally a field, but its value never ends.
InvalidDataLength
A Length/Data field pair declares a byte count the frame cannot satisfy.
Raised when the count declared by a LENGTH field (for example
RawDataLength, tag 95) runs past what the field may consume, or when
the byte at the declared end of the DATA field is not the SOH
delimiter.
Fields
RangeOutOfBounds
A stored byte range does not lie within the message buffer.
Guards the offset bookkeeping in crate::message::RawMessage, whose
ranges are buffer-relative.
Fields
InvalidMsgType(MsgTypeError)
The MsgType value (tag 35) is not a representable message type.
Raised when the bytes of tag 35 are empty, longer than
crate::message::MSG_TYPE_MAX_LEN, or contain a byte that cannot
appear in a MsgType. The frame is rejected rather than routed under a
truncated or defaulted message type.
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
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()