Trait embedded_hal_async::serial::Write

source ·
pub trait Write<Word: 'static + Copy = u8>: ErrorType {
    // Required methods
    async fn write(&mut self, words: &[Word]) -> Result<(), Self::Error>;
    async fn flush(&mut self) -> Result<(), Self::Error>;
}
Expand description

Write half of a serial interface

Required Methods§

source

async fn write(&mut self, words: &[Word]) -> Result<(), Self::Error>

Writes a slice, blocking until everything has been written.

An implementation can choose to buffer the write, returning Ok(()) after the complete slice has been written to a buffer, but before all words have been sent via the serial interface. To make sure that everything has been sent, call flush after this function returns.

source

async fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written data is still buffered

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Write<Word>, Word: 'static + Copy> Write<Word> for &mut T

source§

async fn write(&mut self, words: &[Word]) -> Result<(), Self::Error>

source§

async fn flush(&mut self) -> Result<(), Self::Error>

Implementors§