pub trait Transport<'a> {
// Required methods
fn set_client(&self, client: &'a dyn TransportClient);
fn send(
&self,
kind: DataKind,
buffer: &'static mut [u8],
len: usize,
) -> Result<(), (ErrorCode, &'static mut [u8])>;
}Expand description
Bus that connects the controller.
Required Methods§
fn set_client(&self, client: &'a dyn TransportClient)
Sourcefn send(
&self,
kind: DataKind,
buffer: &'static mut [u8],
len: usize,
) -> Result<(), (ErrorCode, &'static mut [u8])>
fn send( &self, kind: DataKind, buffer: &'static mut [u8], len: usize, ) -> Result<(), (ErrorCode, &'static mut [u8])>
Send buffer[1..len] to the controller as kind bytes.
buffer[0] is reserved for the transport (e.g. the I2C control byte).
On success, TransportClient::send_done returns the buffer. len
includes this byte.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".