Struct NoCodec

Source
pub struct NoCodec {}
Expand description

A codec that represents absense of a codec. This has two main usecases:

Firstly, if this is used as the default codec for a device, it essentially requires any associated register to explicitly specify a codec. Otherwise accessing that register via the RegisterInterfaceSync or RegisterInterfaceAsync trait will cause a panic.

Secondly, specifying this codec as the default for a register will cause any reads or writes to that register via the RegisterInterfaceSync or RegisterInterfaceAsync traits to be performed through the default codec of the device.

Trait Implementations§

Source§

impl CodecAsync for NoCodec

Source§

async fn read_register<R, I, A>( _bound_bus: &mut I2cBoundBusAsync<I, A>, ) -> Result<R, I::Error>
where R: ReadableRegister, I: I2c<A> + ErrorType, A: AddressMode + Copy,

Read this register from the given I2C interface/device.
Source§

async fn write_register<R, I, A>( _bound_bus: &mut I2cBoundBusAsync<I, A>, _register: impl AsRef<R>, ) -> Result<(), I::Error>
where R: WritableRegister, I: I2c<A> + ErrorType, A: AddressMode + Copy,

Write this register to the given I2C interface/device.
Source§

impl CodecSync for NoCodec

Source§

fn read_register<R, I, A>( _bound_bus: &mut I2cBoundBusSync<I, A>, ) -> Result<R, I::Error>
where R: ReadableRegister, I: I2c<A> + ErrorType, A: AddressMode + Copy,

Read this register from the given I2C interface/device.
Source§

fn write_register<R, I, A>( _bound_bus: &mut I2cBoundBusSync<I, A>, _register: impl AsRef<R>, ) -> Result<(), I::Error>
where R: WritableRegister, I: I2c<A> + ErrorType, A: AddressMode + Copy,

Write this register to the given I2C interface/device.
Source§

impl Default for NoCodec

Source§

fn default() -> NoCodec

Returns the “default value” for a type. 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> 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.