pub struct BufferOperation<'b, B, AddressType, Access>{ /* private fields */ }Expand description
Intermediate type for doing buffer operations
If the interface error implements [embedded_io::Error],
then this operation type also implements the [embedded_io] traits
Implementations§
Source§impl<'b, B, AddressType, Access> BufferOperation<'b, B, AddressType, Access>
impl<'b, B, AddressType, Access> BufferOperation<'b, B, AddressType, Access>
Sourcepub fn write(
&mut self,
buf: &[u8],
) -> Result<usize, <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
pub fn write(
&mut self,
buf: &[u8],
) -> Result<usize, <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
Write a buffer into this writer, returning how many bytes were written.
Mirror function of [embedded_io::Write::write].
Sourcepub fn write_async(
&mut self,
buf: &[u8],
) -> impl Future<Output = Result<usize, <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
pub fn write_async(
&mut self,
buf: &[u8],
) -> impl Future<Output = Result<usize, <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
Write a buffer into this writer, returning how many bytes were written.
Mirror function of [embedded_io_async::Write::write].
Sourcepub fn write_all(
&mut self,
buf: &[u8],
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
pub fn write_all(
&mut self,
buf: &[u8],
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
Write an entire buffer into this writer.
This function calls write() in a loop until exactly buf.len() bytes have been written, blocking if needed.
Mirror function of [embedded_io::Write::write_all].
Sourcepub async fn write_all_async(
&mut self,
buf: &[u8],
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
pub async fn write_all_async(
&mut self,
buf: &[u8],
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
Write an entire buffer into this writer.
This function calls write() in a loop until exactly buf.len() bytes have been written, blocking if needed.
Mirror function of [embedded_io_async::Write::write_all].
Sourcepub fn flush(
&mut self,
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
pub fn flush(
&mut self,
) -> Result<(), <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: WriteCapability,
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Mirror function of [embedded_io::Write::flush].
Sourcepub fn flush_async(
&mut self,
) -> impl Future<Output = Result<(), <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
pub fn flush_async(
&mut self,
) -> impl Future<Output = Result<(), <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: WriteCapability,
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Mirror function of [embedded_io_async::Write::flush].
Sourcepub fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize, <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: ReadCapability,
pub fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize, <B::Interface as BufferInterfaceBase>::Error>where
B::Interface: BufferInterface,
Access: ReadCapability,
Read some bytes from this source into the specified buffer, returning how many bytes were read.
Mirror function of [embedded_io::Read::read].
Sourcepub fn read_async(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize, <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: ReadCapability,
pub fn read_async(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize, <B::Interface as BufferInterfaceBase>::Error>>where
B::Interface: AsyncBufferInterface,
Access: ReadCapability,
Read some bytes from this source into the specified buffer, returning how many bytes were read.
Mirror function of [embedded_io_async::Read::read].