pub struct RxAsync(/* private fields */);Expand description
Core data structure to allow asynchronous UART reception.
If the ring buffer becomes full, data will be lost.
Implementations§
Source§impl RxAsync
impl RxAsync
Sourcepub fn new(rx: Rx, queue: Consumer<'static, u8>) -> Self
pub fn new(rx: Rx, queue: Consumer<'static, u8>) -> Self
Create a new asynchronous receiver.
The passed heapless::spsc::Consumer will be used to asynchronously receive data which is filled by the interrupt handler on_interrupt_rx.
pub fn stop(&mut self)
pub fn release(self) -> (Rx, Consumer<'static, u8>)
Trait Implementations§
Source§impl ErrorType for RxAsync
impl ErrorType for RxAsync
Source§type Error = Infallible
type Error = Infallible
Error reporting is done using the result of the interrupt functions.
Source§impl Read for RxAsync
impl Read for RxAsync
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>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
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>>
Read the exact number of bytes required to fill
buf. Read moreAuto Trait Implementations§
impl Freeze for RxAsync
impl !RefUnwindSafe for RxAsync
impl Send for RxAsync
impl !Sync for RxAsync
impl Unpin for RxAsync
impl UnsafeUnpin for RxAsync
impl !UnwindSafe for RxAsync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more