#[non_exhaustive]pub enum MavlinkError {
Show 17 variants
FrameTooShort,
BadMagic(u8),
Truncated,
CrcMismatch {
expected: u16,
found: u16,
},
UnknownMessage(u32),
PayloadTooLong,
Unsigned,
BadSignature,
ReplayedTimestamp,
BadPayload,
UnknownField,
UnknownFieldType,
DuplicateField,
FieldTypeMismatch,
FieldIndexOutOfRange,
ValueOutOfRange,
Closed,
}Expand description
A fault encountered while building, parsing, signing, or verifying a frame.
This enum is #[non_exhaustive]: new variants may be added without a breaking
change, so a downstream match must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FrameTooShort
The bytes are shorter than the smallest valid frame of their version.
BadMagic(u8)
The first byte is neither the v1 (0xFE) nor the v2 (0xFD) start marker.
Truncated
The buffer ended before the frame its length field promised was complete.
CrcMismatch
The trailing checksum did not match the one computed over the frame.
Fields
UnknownMessage(u32)
A message id has no known CRC_EXTRA, so its checksum cannot be validated and
its payload cannot be decoded.
PayloadTooLong
A payload, frame, or field array was larger than the protocol or buffer allows.
Unsigned
A signature was required but the frame was not signed.
BadSignature
The frame’s signature did not match the one computed with the key.
ReplayedTimestamp
The frame’s signing timestamp was older than the link’s replay window allows.
BadPayload
A typed message was decoded from a payload of the wrong size or shape.
UnknownField
The message has no field of the requested name.
UnknownFieldType
A field type name is not one MAVLink defines.
DuplicateField
A message shape names the same field twice.
FieldTypeMismatch
A field was read or written as a kind its type is not.
FieldIndexOutOfRange
An array element index is past the end of the field.
ValueOutOfRange
A value does not fit the field’s type.
Closed
The link reached end of input before a frame could be read.
Trait Implementations§
Source§impl Clone for MavlinkError
impl Clone for MavlinkError
Source§fn clone(&self) -> MavlinkError
fn clone(&self) -> MavlinkError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MavlinkError
Source§impl Debug for MavlinkError
impl Debug for MavlinkError
Source§impl Display for MavlinkError
impl Display for MavlinkError
impl Eq for MavlinkError
Source§impl Error for MavlinkError
Available on crate feature std only.
impl Error for MavlinkError
std only.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()
Source§impl PartialEq for MavlinkError
impl PartialEq for MavlinkError
Source§fn eq(&self, other: &MavlinkError) -> bool
fn eq(&self, other: &MavlinkError) -> bool
self and other values to be equal, and is used by ==.