Skip to main content

BufferOperation

Struct BufferOperation 

Source
pub struct BufferOperation<'b, B, AddressType, Access>
where B: Block, B::Interface: BufferInterfaceBase<AddressType = AddressType>, AddressType: Address,
{ /* 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>
where B: Block, B::Interface: BufferInterfaceBase<AddressType = AddressType>, AddressType: Address,

Source

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].

Source

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].

Source

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].

Source

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].

Source

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].

Source

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].

Source

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].

Source

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].

Auto Trait Implementations§

§

impl<'b, B, AddressType, Access> !UnwindSafe for BufferOperation<'b, B, AddressType, Access>

§

impl<'b, B, AddressType, Access> Freeze for BufferOperation<'b, B, AddressType, Access>
where AddressType: Freeze,

§

impl<'b, B, AddressType, Access> RefUnwindSafe for BufferOperation<'b, B, AddressType, Access>
where AddressType: RefUnwindSafe, B: RefUnwindSafe, Access: RefUnwindSafe,

§

impl<'b, B, AddressType, Access> Send for BufferOperation<'b, B, AddressType, Access>
where AddressType: Send, B: Send, Access: Send,

§

impl<'b, B, AddressType, Access> Sync for BufferOperation<'b, B, AddressType, Access>
where AddressType: Sync, B: Sync, Access: Sync,

§

impl<'b, B, AddressType, Access> Unpin for BufferOperation<'b, B, AddressType, Access>
where AddressType: Unpin, Access: Unpin,

§

impl<'b, B, AddressType, Access> UnsafeUnpin for BufferOperation<'b, B, AddressType, Access>
where AddressType: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.