pub struct BufferOperation<'i, Interface, AddressType: Copy, 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<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Access: WriteCapability,
impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Access: WriteCapability,
Sourcepub fn write(&mut self, buf: &[u8]) -> Result<usize, Interface::Error>
pub fn write(&mut self, buf: &[u8]) -> Result<usize, Interface::Error>
Write a buffer into this writer, returning how many bytes were written.
Mirror function of embedded_io::Write::write.
Source§impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Access: ReadCapability,
impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Access: ReadCapability,
Sourcepub fn read(&mut self, buf: &mut [u8]) -> Result<usize, Interface::Error>
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, Interface::Error>
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_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Interface::Error>>
pub fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Interface::Error>>
Read the exact number of bytes required to fill buf. This function calls read() in a loop until exactly buf.len() bytes have been read, blocking if needed.
Mirror function of embedded_io::Read::read_exact.
Source§impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: WriteCapability,
impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: WriteCapability,
Sourcepub async fn write_async(
&mut self,
buf: &[u8],
) -> Result<usize, Interface::Error>
pub async fn write_async( &mut self, buf: &[u8], ) -> Result<usize, Interface::Error>
Write a buffer into this writer, returning how many bytes were written.
Mirror function of embedded_io_async::Write::write.
Sourcepub async fn write_all_async(
&mut self,
buf: &[u8],
) -> Result<(), Interface::Error>
pub async fn write_all_async( &mut self, buf: &[u8], ) -> Result<(), Interface::Error>
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 async fn flush_async(&mut self) -> Result<(), Interface::Error>
pub async fn flush_async(&mut self) -> Result<(), Interface::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Mirror function of embedded_io_async::Write::flush.
Source§impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: ReadCapability,
impl<Interface, AddressType: Copy, Access> BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: ReadCapability,
Sourcepub async fn read_async(
&mut self,
buf: &mut [u8],
) -> Result<usize, Interface::Error>
pub async fn read_async( &mut self, buf: &mut [u8], ) -> Result<usize, Interface::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read.
Mirror function of embedded_io_async::Read::read.
Sourcepub async fn read_exact_async(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Interface::Error>>
pub async fn read_exact_async( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Interface::Error>>
Read the exact number of bytes required to fill buf.
This function calls read() in a loop until exactly buf.len() bytes have been read, waiting if needed.
Mirror function of embedded_io_async::Read::read_exact.
Trait Implementations§
Source§impl<Interface, AddressType: Copy, Access> ErrorType for BufferOperation<'_, Interface, AddressType, Access>
impl<Interface, AddressType: Copy, Access> ErrorType for BufferOperation<'_, Interface, AddressType, Access>
Source§type Error = <Interface as BufferInterfaceError>::Error
type Error = <Interface as BufferInterfaceError>::Error
Source§impl<Interface, AddressType: Copy, Access> Read for BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: ReadCapability,
impl<Interface, AddressType: Copy, Access> Read for BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: ReadCapability,
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf
. Read moreSource§impl<Interface, AddressType: Copy, Access> Read for BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: ReadCapability,
impl<Interface, AddressType: Copy, Access> Read for BufferOperation<'_, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: ReadCapability,
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf
. Read more