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

# Trait embedded_hal::blocking::serial::Write

source · [−]

    pub trait Write<Word> {
        type Error;
        fn try_bwrite_all(&mut self, buffer: &[Word]) -> Result<(), Self::Error>;
        fn try_bflush(&mut self) -> Result<(), Self::Error>;
    }

Expand description

Write half of a serial interface (blocking variant)

## Associated Types

source

#### type Error

The type of error that can occur when writing

## Required methods

source

#### fn try_bwrite_all(&mut self, buffer: &[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 `try_bflush` after this function returns.

source

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

Block until the serial interface has sent all buffered words

## Implementors

source

### impl<S, Word> Write<Word> for S where
S: Default<Word>,
Word: Clone,

#### type Error = S::Error