embedded_packet_io/
lib.rs1#![no_std]
2
3use embedded_io::ErrorType;
4pub trait ReadPacket<const N: usize>: ErrorType {
5 fn read_packet(&mut self) -> Result<heapless::Vec<u8, N>, Self::Error>;
6}
7pub trait AsyncReadPacket<const N: usize>: ErrorType {
8 async fn read_packet(&mut self) -> Result<heapless::Vec<u8, N>, Self::Error>;
9}
10pub trait WritePacket<const N: usize>: ErrorType{
11 fn write_packet(&mut self, x: heapless::Vec<u8,N>) -> Result<(),Self::Error>;
12 fn flush(&mut self) -> Result<(),Self::Error>;
13}
14pub trait AsyncWritePacket<const N: usize>: ErrorType{
15 async fn write_packet(&mut self, x: heapless::Vec<u8,N>) -> Result<(),Self::Error>;
16 async fn flush(&mut self) -> Result<(),Self::Error>;
17}
18pub mod stitch;