Skip to main content

EmbeddedIo

Struct EmbeddedIo 

Source
pub struct EmbeddedIo<W>(pub W);
Available on crate features embedded-io-async or embedded-io only.
Expand description

An embedded-io writer as a sink: a Sink for embedded_io::Write, and with Seek a PatchSink; with embedded-io-async, likewise an AsyncSink and AsyncPatchSink.

Tuple Fields§

§0: W

Trait Implementations§

Source§

impl<W: Write + Seek> AsyncPatchSink for EmbeddedIo<W>

Available on crate feature embedded-io-async only.
Source§

async fn patch(&mut self, back: u32, bytes: &[u8]) -> Result<(), Self::Error>

Available on crate feature async only.
Overwrites the bytes starting back bytes before the end of what was written, as PatchSink::patch does. Read more
Source§

impl<W: Write> AsyncSink for EmbeddedIo<W>

Available on crate feature embedded-io-async only.
Source§

type Error = EmbeddedIoError<<W as ErrorType>::Error>

Available on crate feature async only.
Why a write failed.
Source§

async fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>

Available on crate feature async only.
Writes all of bytes, or fails. Read more
Source§

async fn begin(&mut self, _file_size: u32) -> Result<(), Self::Error>

Available on crate feature async only.
The whole file’s length, as Sink::begin has it: only write_async calls this. Read more
Source§

impl<W: Debug> Debug for EmbeddedIo<W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: Write + Seek> PatchSink for EmbeddedIo<W>

Available on crate feature embedded-io only.
Source§

fn patch(&mut self, back: u32, bytes: &[u8]) -> Result<(), Self::Error>

Overwrites the bytes starting back bytes before the end of what was written. A call that would reach before the start or past the end must change nothing, and fails if the sink’s error can say so; OnePass never makes one. Read more
Source§

impl<W: Write> Sink for EmbeddedIo<W>

Available on crate feature embedded-io only.
Source§

type Error = EmbeddedIoError<<W as ErrorType>::Error>

Why a write failed.
Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>

Writes all of bytes, or fails. Read more
Source§

fn begin(&mut self, _file_size: u32) -> Result<(), Self::Error>

The whole file’s length, for a sink that announces it, such as a transfer over a radio link. Only write() knows it in advance and calls this, once, before the first byte; OnePass never does. Read more

Auto Trait Implementations§

§

impl<W> Forget for EmbeddedIo<W>

§

impl<W> Freeze for EmbeddedIo<W>
where W: Freeze,

§

impl<W> Move for EmbeddedIo<W>

§

impl<W> RefUnwindSafe for EmbeddedIo<W>
where W: RefUnwindSafe,

§

impl<W> Send for EmbeddedIo<W>
where W: Send,

§

impl<W> Sync for EmbeddedIo<W>
where W: Sync,

§

impl<W> Unpin for EmbeddedIo<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for EmbeddedIo<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for EmbeddedIo<W>
where W: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.