Skip to main content

I2cErrorKind

Enum I2cErrorKind 

Source
#[non_exhaustive]
pub enum I2cErrorKind { AddressNack, DataNack, ArbitrationLost, ClockStretchTimeout, BusBusy, BusProtocolError, AdapterGone, Unknown { errno: i32, }, }
Expand description

The class of I²C bus condition that caused the failure.

Variants follow the conventions in Documentation/i2c/fault-codes.rst. See the amdgpu note in the crate documentation for current hardware limitations.

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

AddressNack

The slave did not acknowledge its I²C address byte (ENXIO).

§

DataNack

The slave acknowledged its address but NACKed a data byte.

§

ArbitrationLost

Arbitration was lost to another bus master (EAGAIN). Retry is appropriate.

§

ClockStretchTimeout

The slave held SCL low beyond the adapter timeout threshold (ETIMEDOUT).

§

BusBusy

The bus was busy and the transaction could not be started (EBUSY).

§

BusProtocolError

An unexpected START or STOP condition was observed on the bus (EPROTO).

§

AdapterGone

The I²C adapter was suspended or removed (ESHUTDOWN/ENODEV).

§

Unknown

An errno that does not map to any known I²C condition.

Fields

§errno: i32

The raw OS error number.

Trait Implementations§

Source§

impl Debug for I2cErrorKind

Source§

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

Formats the value using the given formatter. Read more

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> ExtensionData for T
where T: Any + Debug + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns self as &dyn Any to enable downcasting.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.