# Write in embedded_hal::serial - Rust
Write half of a serial interface
Keywords: rust, rustlang, rust-lang, Write

# Trait embedded_hal::serial::Write

source · [−]

    pub trait Write<Word> {
        type Error;
        fn try_write(&mut self, word: Word) -> Result<(), Self::Error>;
        fn try_flush(&mut self) -> Result<(), Self::Error>;
    }

Expand description

Write half of a serial interface

## Associated Types

source

#### type Error

Write error

## Required methods

source

#### fn try_write(&mut self, word: Word) -> Result<(), Self::Error>

Writes a single word to the serial interface

source

#### fn try_flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered

## Trait Implementations

source

### impl<Word, Error> Write for dyn Write<Word, Error = Error> where
Word: From<u8>,

source

#### fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write succeeded. Read more

1.1.0 · source

#### fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a `char` into this writer, returning whether the write succeeded. Read more

1.0.0 · source

#### fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the `write!` macro with implementors of this trait. Read more

## Implementors