Skip to main content

MavlinkError

Enum MavlinkError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§expected: u16

The checksum computed over the received bytes.

§found: u16

The checksum the frame carried.

§

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

Source§

fn clone(&self) -> MavlinkError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MavlinkError

Source§

impl Debug for MavlinkError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MavlinkError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MavlinkError

Source§

impl Error for MavlinkError

Available on crate feature std only.
1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for MavlinkError

Source§

fn eq(&self, other: &MavlinkError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MavlinkError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.