Skip to main content

AsyncCommandInterface

Trait AsyncCommandInterface 

Source
pub trait AsyncCommandInterface: CommandInterfaceBase {
    // Required method
    async fn dispatch_command(
        &mut self,
        address: Self::AddressType,
        input: &mut [u8],
        _input_metadata: &FieldsetMetadata,
        output: &mut [u8],
        _output_metadata: &FieldsetMetadata,
    ) -> Result<(), Self::Error>;
}
Expand description

A trait to represent the interface to the device.

This is called to asynchronously dispatch commands.

Required Methods§

Source

async fn dispatch_command( &mut self, address: Self::AddressType, input: &mut [u8], _input_metadata: &FieldsetMetadata, output: &mut [u8], _output_metadata: &FieldsetMetadata, ) -> 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".

Implementations on Foreign Types§

Source§

impl<T: AsyncCommandInterface> AsyncCommandInterface for &mut T

Source§

fn dispatch_command( &mut self, address: Self::AddressType, input: &mut [u8], input_metadata: &FieldsetMetadata, output: &mut [u8], output_metadata: &FieldsetMetadata, ) -> impl Future<Output = Result<(), Self::Error>>

Implementors§