Enum Error

Source
pub enum Error {
Show 21 variants UnknownEvent(u8), BadLength(usize, usize), BadStatus(u8), BadLinkType(u8), BadEncryptionEnabledValue(u8), BadReason(u8), BadEncryptionType(u8), UnknownOpcode(Opcode), BadCommandFlag, InvalidChannelMap([u8; 5]), InvalidLeStates(u64), BadLeConnectionRole(u8), BadLeAddressType(u8), BadConnectionInterval(ConnectionIntervalError), BadLeCentralClockAccuracy(u8), LeAdvertisementReportIncomplete, BadLeAdvertisementType(u8), BadRemoteUsedFeatureFlag(u64), BadPhy(u8), BadHardwareError(u8), Vendor(VendorError),
}
Expand description

Errors that may occur when deserializing an event. Must be specialized by the vendor crate to allow for vendor-specific event errors.

Variants§

§

UnknownEvent(u8)

The event type byte was unknown. The byte is provided.

§

BadLength(usize, usize)

The buffer provided that is supposed to contain an event does not have the correct length. Field 0 is the provided length, field 1 is the expected length.

§

BadStatus(u8)

For all events: The status was not recognized (reserved for future use). Includes the unrecognized byte.

§

BadLinkType(u8)

For the Connection Complete or Data Buffer Overflow events: the link type was not recognized (reserved for future use). Includes the unrecognized byte.

§

BadEncryptionEnabledValue(u8)

For the Connection Complete event: the encryption enabled value was not recognized (reserved for future use). Includes the unrecognized byte.

§

BadReason(u8)

For the Disconnection Complete event: the disconnection reason was not recognized. Includes the unrecognized byte.

§

BadEncryptionType(u8)

For the Encryption Change event: The encryption type was not recognized. Includes the unrecognized byte.

§

UnknownOpcode(Opcode)

For the Command Complete event: The event indicated a command completed whose opcode was not recognized. Includes the unrecognized opcode.

§

BadCommandFlag

For the Command Complete event, for the Read Local Supported Commands command return parameters: The returned command flags are invalid (i.e., they include a flag that is reserved for future use).

§

InvalidChannelMap([u8; 5])

For the Command Complete event, for the LE Read Channel Map command return parameters: The returned channel map includes a reserved bit.

§

InvalidLeStates(u64)

For the Command Complete event, for the LE Read Supported States command return parameters: The returned supported states bitfield includes a reserved bit.

§

BadLeConnectionRole(u8)

For the LE Connection Complete event: The connection role was not recognized. Includes the unrecognized byte.

§

BadLeAddressType(u8)

For the LE Connection Complete or LE Advertising Report events: The address type was not recognized. Includes the unrecognized byte.

§

BadConnectionInterval(ConnectionIntervalError)

For the LE Connection Complete event: The returned connection interval was invalid. Includes the error returned when attempting to create the FixedConnectionInterval.

§

BadLeCentralClockAccuracy(u8)

For the LE Connection Complete event: The central clock accuracy value was not recognized. Includes the unrecognized byte.

§

LeAdvertisementReportIncomplete

For the LE Advertising Report event: The packet ended with a partial report.

§

BadLeAdvertisementType(u8)

For the LE Advertising Report event: The packet includes an invalid advertisement type. Includes the unrecognized byte.

§

BadRemoteUsedFeatureFlag(u64)

For the LE Read Remote Used Features Complete event: The response included an invalid bit set for the remote features. Includes the 8 bytes of flags.

§

BadPhy(u8)

For the LE PHY Update Complete event: The PHY type was not recognized. Includes the unrecognized byte.

§

BadHardwareError(u8)

For the Hardware Error event: The error code was not recongnized. Includes the unrecongnized code.

§

Vendor(VendorError)

A vendor-specific error was detected when deserializing a vendor-specific event.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

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

impl PartialEq for Error

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Copy for Error

Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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, 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.