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<'i, Interface, AddressType: Copy, Access> BufferOperation<'i, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: WriteCapability,
impl<'i, Interface, AddressType: Copy, Access> BufferOperation<'i, 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<'i, Interface, AddressType: Copy, Access> BufferOperation<'i, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Access: ReadCapability,
impl<'i, Interface, AddressType: Copy, Access> BufferOperation<'i, 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<'i, Interface, AddressType: Copy, Access> Read for BufferOperation<'i, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: ReadCapability,
impl<'i, Interface, AddressType: Copy, Access> Read for BufferOperation<'i, 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 moreSource§impl<Interface, AddressType: Copy, Access> Write for BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: WriteCapability,
impl<Interface, AddressType: Copy, Access> Write for BufferOperation<'_, Interface, AddressType, Access>where
Interface: BufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: WriteCapability,
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Source§impl<'i, Interface, AddressType: Copy, Access> Write for BufferOperation<'i, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: WriteCapability,
impl<'i, Interface, AddressType: Copy, Access> Write for BufferOperation<'i, Interface, AddressType, Access>where
Interface: AsyncBufferInterface<AddressType = AddressType>,
Interface::Error: Error,
Access: WriteCapability,
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Auto Trait Implementations§
impl<'i, Interface, AddressType, Access> Freeze for BufferOperation<'i, Interface, AddressType, Access>where
AddressType: Freeze,
impl<'i, Interface, AddressType, Access> RefUnwindSafe for BufferOperation<'i, Interface, AddressType, Access>
impl<'i, Interface, AddressType, Access> Send for BufferOperation<'i, Interface, AddressType, Access>
impl<'i, Interface, AddressType, Access> Sync for BufferOperation<'i, Interface, AddressType, Access>
impl<'i, Interface, AddressType, Access> Unpin for BufferOperation<'i, Interface, AddressType, Access>
impl<'i, Interface, AddressType, Access> !UnwindSafe for BufferOperation<'i, Interface, AddressType, Access>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.