pub struct AsyncUart { /* private fields */ }Expand description
Async wrapper around an ove::Uart.
Same lifetime contract as the other Async* wrappers: methods take
&'static self because the C-side notify callback retains a
pointer to the internal AtomicWaker.
Implementations§
Source§impl AsyncUart
impl AsyncUart
pub const fn new(inner: Uart) -> Self
Sourcepub fn arm(&'static self) -> Result<()>
pub fn arm(&'static self) -> Result<()>
Register the C-side notify callback. Must be called exactly once after the wrapper reaches its final ’static location.
Trait Implementations§
Source§impl Read for &'static AsyncUart
impl Read for &'static AsyncUart
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 moreimpl Send for AsyncUart
impl Sync for AsyncUart
Auto Trait Implementations§
impl !Freeze for AsyncUart
impl !RefUnwindSafe for AsyncUart
impl Unpin for AsyncUart
impl UnsafeUnpin for AsyncUart
impl UnwindSafe for AsyncUart
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