pub trait I2cIter<A: AddressMode>: I2c<A> {
// Required method
fn transaction_iter<'a, O, B>(
&mut self,
address: A,
operations: O,
) -> Result<(), Self::Error>
where O: IntoIterator<Item = Operation<'a, B>>,
B: IntoIterator<Item = u8>;
// Provided methods
fn write_iter<B>(&mut self, address: A, bytes: B) -> Result<(), Self::Error>
where B: IntoIterator<Item = u8> { ... }
fn write_iter_read<B>(
&mut self,
address: A,
bytes: B,
buffer: &mut [u8],
) -> Result<(), Self::Error>
where B: IntoIterator<Item = u8> { ... }
}
Required Methods§
Sourcefn transaction_iter<'a, O, B>(
&mut self,
address: A,
operations: O,
) -> Result<(), Self::Error>
fn transaction_iter<'a, O, B>( &mut self, address: A, operations: O, ) -> Result<(), Self::Error>
Execute the provided operations on the I2C bus.
Same as I2c::transaction
but with an interator instead of a slice of operations.
Provided Methods§
Sourcefn write_iter<B>(&mut self, address: A, bytes: B) -> Result<(), Self::Error>where
B: IntoIterator<Item = u8>,
fn write_iter<B>(&mut self, address: A, bytes: B) -> Result<(), Self::Error>where
B: IntoIterator<Item = u8>,
Writes bytes to slave with address address
Same as I2c::write
but with an interator instead of a slice of bytes.
Sourcefn write_iter_read<B>(
&mut self,
address: A,
bytes: B,
buffer: &mut [u8],
) -> Result<(), Self::Error>where
B: IntoIterator<Item = u8>,
fn write_iter_read<B>(
&mut self,
address: A,
bytes: B,
buffer: &mut [u8],
) -> Result<(), Self::Error>where
B: IntoIterator<Item = u8>,
Writes bytes to slave with address address
and then reads enough bytes to fill buffer
in a
single transaction
Same as I2c::write_read
but with an interator instead of a slice of bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.