pub trait PacketLink {
// Required methods
fn max_packet_len(&self) -> usize;
async fn send(&mut self, packet: &[u8]) -> Result<()>;
async fn receive(&mut self, timeout: Duration) -> Result<Vec<u8>>;
async fn purge(&mut self) -> Result<()>;
}Expand description
A packet link that keeps message boundaries: USB HID reports, USB bulk transfers or BLE characteristic writes and notifications.
Required Methods§
Sourcefn max_packet_len(&self) -> usize
fn max_packet_len(&self) -> usize
The largest packet send accepts, in bytes. For BLE this is the
ATT MTU minus 3.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".