# WriteIterRead in embedded_hal::blocking::i2c - Rust
Blocking write (iterator version) + read
Keywords: rust, rustlang, rust-lang, WriteIterRead

# Trait embedded_hal::blocking::i2c::WriteIterRead

source · [−]

    pub trait WriteIterRead {
        type Error;
        fn try_write_iter_read<B>(
            &mut self,
            address: u8,
            bytes: B,
            buffer: &mut [u8]
        ) -> Result<(), Self::Error>
        where
            B: IntoIterator<Item = u8>;
    }

Expand description

Blocking write (iterator version) + read

## Associated Types

source

#### type Error

Error type

## Required methods

source

#### fn try_write_iter_read<B>(
&mut self,
address: u8,
bytes: B,
buffer: &mut [ u8 ]
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,

Sends bytes to slave with address `addr` and then reads enough bytes to fill `buffer` in a single transaction

##### I2C Events (contract)

Same as the `WriteRead` trait

## Implementors