Skip to main content

FromEmbedded

Struct FromEmbedded 

Source
pub struct FromEmbedded<T>(pub T);
Expand description

Explicitly expose an embedded-io value through Hadris traits.

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> FromEmbedded<T>

Source

pub const fn new(inner: T) -> Self

Wrap an embedded I/O value.

Source

pub fn into_inner(self) -> T

Recover the wrapped value.

Source

pub const fn get_ref(&self) -> &T

Borrow the wrapped value.

Source

pub fn get_mut(&mut self) -> &mut T

Mutably borrow the wrapped value.

Trait Implementations§

Source§

impl<T: Clone> Clone for FromEmbedded<T>

Source§

fn clone(&self) -> FromEmbedded<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy> Copy for FromEmbedded<T>

Source§

impl<T: Debug> Debug for FromEmbedded<T>

Source§

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

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

impl<T: Default> Default for FromEmbedded<T>

Source§

fn default() -> FromEmbedded<T>

Returns the “default value” for a type. Read more
Source§

impl<T: Read> Read for FromEmbedded<T>

Source§

type Error = <T as ErrorType>::Error

Error returned by the underlying source.
Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes, returning zero at end of input.
Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Fill buf, retrying interrupted operations.
Source§

impl<T: Seek> Seek for FromEmbedded<T>

Source§

type Error = <T as ErrorType>::Error

Error returned by the underlying stream.
Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Self::Error>

Seek to a new byte position.
Source§

fn stream_position(&mut self) -> Result<u64, Self::Error>

Return the current byte position.
Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Self::Error>

Seek relative to the current byte position.
Source§

impl<T: Write> Write for FromEmbedded<T>

Source§

type Error = <T as ErrorType>::Error

Error returned by the underlying destination.
Source§

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

Write some bytes.
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Flush buffered output.
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<()>

Write all bytes, retrying interrupted operations.

Auto Trait Implementations§

§

impl<T> Freeze for FromEmbedded<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for FromEmbedded<T>
where T: RefUnwindSafe,

§

impl<T> Send for FromEmbedded<T>
where T: Send,

§

impl<T> Sync for FromEmbedded<T>
where T: Sync,

§

impl<T> Unpin for FromEmbedded<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for FromEmbedded<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for FromEmbedded<T>
where T: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ReadExt for T
where T: Read + ?Sized,

Source§

fn read_struct<T: Zeroable + NoUninit + AnyBitPattern>(&mut self) -> Result<T>

Read an arbitrary-bit-pattern value.
Source§

fn parse<T: Parsable>(&mut self) -> Result<T>
where Self: Sized,

Parse a value with its custom parser.
Source§

impl<T> ReadSeek for T
where T: Read + Seek<Error = <T as Read>::Error> + ?Sized,

Source§

impl<T> ReadWrite for T
where T: Read + Write<Error = <T as Read>::Error> + ?Sized,

Source§

impl<T> ReadWriteSeek for T
where T: Write<Error = <T as Read>::Error> + Seek<Error = <T as Read>::Error> + Read + ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.