Trait AsyncCommandInterface

Source
pub trait AsyncCommandInterface {
    type Error;
    type AddressType: Copy;

    // Required method
    async fn dispatch_command(
        &mut self,
        address: Self::AddressType,
        size_bits_in: u32,
        input: &[u8],
        size_bits_out: u32,
        output: &mut [u8],
    ) -> Result<(), Self::Error>;
}
Expand description

A trait to represent the interface to the device.

This is called to asynchronously dispatch commands.

Required Associated Types§

Source

type Error

The error type

Source

type AddressType: Copy

The address type used by this interface. Should likely be an integer.

Required Methods§

Source

async fn dispatch_command( &mut self, address: Self::AddressType, size_bits_in: u32, input: &[u8], size_bits_out: u32, output: &mut [u8], ) -> Result<(), Self::Error>

Dispatch a command on the device by sending the command.

The input is the content that needs to be sent to the device. The output is the buffer where the response needs to be written to.

The slices are empty if the respective in or out fields are not specified.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§