pub enum MarshalerError {
InvalidCmdID {
expected: u16,
found: u16,
},
InvalidDataLength {
expected: usize,
found: usize,
},
BufferTooSmall {
need: usize,
},
Unexpected {
code: usize,
message: &'static str,
},
}Expand description
Errors returned by
Marshaler::marshal,
Marshaler::unmarshal,
and RawFrame::unmarshal.
Variants§
InvalidCmdID
The frame’s command ID does not match the expected type.
Returned by
RawFrame::unmarshal
when M::CMD_ID differs from the
command ID in the decoded frame.
InvalidDataLength
The payload length does not match Marshaler::PAYLOAD_SIZE.
Returned by
RawFrame::unmarshal
when the payload size in the frame differs from the size the target type expects.
BufferTooSmall
The destination buffer is too small to hold the serialized payload.
need is the minimum buffer size required, in bytes.
Unexpected
An error specific to the payload type prevented successful marshaling or unmarshaling.
This is a catch-all variant for errors that do not fit into the above categories.
The inner error type and message are determined by the specific implementation of
Marshaler::marshal or
Marshaler::unmarshal.