Skip to main content

RegisterInterfaceSync

Trait RegisterInterfaceSync 

Source
pub trait RegisterInterfaceSync {
    type BusError: Debug;

    // Required methods
    fn read_register<R>(
        &mut self,
    ) -> Result<R, TransportError<<R as Register>::CodecError, Self::BusError>>
       where R: ReadableRegister;
    fn write_register<R>(
        &mut self,
        register: impl AsRef<R>,
    ) -> Result<(), TransportError<<R as Register>::CodecError, Self::BusError>>
       where R: WritableRegister;
}
Expand description

A trait that is implemented by any bus interface and allows devices with registers to share register read/write implementations independent of the actual interface in use.

Required Associated Types§

Source

type BusError: Debug

A type representing errors on the underlying bus

Required Methods§

Source

fn read_register<R>( &mut self, ) -> Result<R, TransportError<<R as Register>::CodecError, Self::BusError>>

Reads the given register through this interface

Source

fn write_register<R>( &mut self, register: impl AsRef<R>, ) -> Result<(), TransportError<<R as Register>::CodecError, Self::BusError>>

Writes the given register through this interface

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§