pub struct BufferedReceiver<'d, D: Driver<'d>> { /* private fields */ }
Expand description
CDC ACM class buffered receiver.
It is a requirement of the embedded_io_async::Read
trait that arbitrarily small lengths of
data can be read from the stream. The Receiver
can only read full packets at a time. The
BufferedReceiver
instead buffers a single packet if the caller does not read all of the data,
so that the remaining data can be returned in subsequent calls.
If you have no requirement to use the embedded_io_async::Read
trait or to read a data length
less than the packet length, then it is more efficient to use the Receiver
directly.
You can obtain a BufferedReceiver
with Receiver::into_buffered
.
Implementations§
Source§impl<'d, D: Driver<'d>> BufferedReceiver<'d, D>
impl<'d, D: Driver<'d>> BufferedReceiver<'d, D>
Sourcepub fn line_coding(&self) -> LineCoding
pub fn line_coding(&self) -> LineCoding
Gets the current line coding. The line coding contains information that’s mainly relevant for USB to UART serial port emulators, and can be ignored if not relevant.
Sourcepub async fn wait_connection(&mut self)
pub async fn wait_connection(&mut self)
Waits for the USB host to enable this interface
Trait Implementations§
Source§impl<'d, D: Driver<'d>> ErrorType for BufferedReceiver<'d, D>
impl<'d, D: Driver<'d>> ErrorType for BufferedReceiver<'d, D>
Source§type Error = EndpointError
type Error = EndpointError
Source§impl<'d, D: Driver<'d>> Read for BufferedReceiver<'d, D>
impl<'d, D: Driver<'d>> Read for BufferedReceiver<'d, D>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf
. Read more